A Python application for constructing phylogenetic trees using the UPGMA (Unweighted Pair Group Method with Arithmetic Mean) algorithm. The program provides a user-friendly graphical interface for sequence analysis and tree visualization.
- Multiple Input Methods:
- DNA/Protein sequences in FASTA format
- Pre-computed distance matrices
- Tree Construction:
- UPGMA algorithm implementation using Biopython
- Automatic sequence alignment and distance calculation
- Interactive tree visualization
- Export Options:
- Save tree in Newick format
- Export tree as high-quality image (PNG, PDF, SVG)
- Generate detailed analysis reports
- Save complete analysis package
- Download the latest release from the releases page
- Extract the ZIP file
- Run
UPGMA_Tree_Builder.exe
- Ensure you have Python 3.7+ installed
- Clone this repository or download the source code
- Create and activate a virtual environment (recommended):
python -m venv .venv # On Windows: .venv\Scripts\activate # On Unix/MacOS: source .venv/bin/activate
- Install required packages:
pip install -r requirements.txt
To create a standalone executable:
-
Ensure all dependencies are installed:
pip install -r requirements.txt
-
Run the build script:
python build.py
-
The executable will be created in the
distdirectory
The build script (build.py) provides several options:
- Creates a single executable file
- Includes the README file
- Adds version information
- Cleans previous build artifacts
- Supports custom icons (place
icon.icoin the project root)
-
Start the application:
python App.py
Or run the executable directly if built.
-
Input Data:
- Choose input type (sequences or distance matrix)
- Load data from file or enter directly
- For sequences, use FASTA format
- For distance matrix, use space-separated values
-
Generate Tree:
- Click "Generate Tree" to construct the phylogenetic tree
- The tree will be displayed in the main window
- Progress and information will be shown in the information panel
-
Export Results:
- Save tree file (Newick format)
- Export tree image
- Generate analysis report
- Save complete analysis package
>Sequence1
ATGCATGC
>Sequence2
ATGCATGT
>Sequence3
ATGCATGA
Sequence1 Sequence2 Sequence3
0.0 0.2 0.4
0.2 0.0 0.3
0.4 0.3 0.0
-
Tree File (.nwk):
- Newick format tree representation
- Compatible with most phylogenetic software
-
Tree Image (.png/.pdf/.svg):
- High-resolution visualization
- Customizable format options
-
Analysis Report (.txt):
- Detailed information about the analysis
- Input data summary
- Tree statistics
- Sequence information (if applicable)
-
Complete Analysis Package:
- All output files in a single directory
- Timestamped for easy organization
- Includes tree file, image, and report
- biopython >= 1.81
- numpy >= 1.21.0
- matplotlib >= 3.4.0
- tk >= 0.1.0
- pyinstaller >= 5.0.0 (for building)
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.