Python package for creating simplified 2D protein visualizations. Specialized on showing differences and similarities between proteins of the same protein family.
Project description
FlatProt
FlatProt is a tool for 2D protein visualization aimed at improving the comparability of protein structures through standardized 2D visualizations. FlatProt focuses on creating highly comparable representations for same-family proteins.
📚 Documentation
📖 Full Documentation - Complete guide with examples, API reference, and tutorials
🔬 Interactive Examples - Jupyter notebooks with Google Colab integration
🧬 Try Now: UniProt to Visualization - From any UniProt ID to beautiful 2D visualization in minutes!
🚀 Quick Start
Installation
FlatProt requires Python 3.11-3.13. Install using uv (recommended):
Option 1: Install and use persistently (recommended)
# Install FlatProt (makes 'flatprot' command available)
uv tool add FlatProt
# Now you can use flatprot directly
flatprot --help
Option 2: Run without installation
# Run FlatProt without installing (use 'uvx flatprot' instead of 'flatprot')
uvx flatprot --help
Dependencies
Required:
Optional:
- Cairo - for PNG/PDF output from overlay command
Basic Usage
Generate a 2D protein visualization from a structure file:
# Option 1: AlphaFold structures (no DSSP needed - secondary structure included!)
flatprot project AF-P69905-F1-model_v4.cif --output protein_2d.svg
# Option 2: PDB/CIF files (add secondary structure first)
mkdssp your_protein.cif your_protein_with_dssp.cif
flatprot project your_protein_with_dssp.cif --output protein_2d.svg
# Note: If using without installation, replace 'flatprot' with 'uvx flatprot'
For detailed installation and usage instructions, see the documentation.
📊 Example Visualizations
Contributing
We welcome contributions to FlatProt! If you'd like to contribute, please follow these steps:
- Fork the repository: Create your own fork of the FlatProt repository on GitHub.
- Create a branch: Make your changes in a dedicated branch in your fork.
- Submit a pull request: Open a pull request from your branch to the
stagingbranch of the t03i/FlatProt repository.
Please ensure your contributions adhere to the project's coding style and include tests where appropriate. For major changes, please open an issue first to discuss what you would like to change.
See CONTRIBUTING.md for more detailed guidelines.
📖 Citation & Data
If you use FlatProt in your research, please cite our preprint:
FlatProt: 2D visualization eases protein structure comparison Tobias Olenyi, Constantin Carl, Tobias Senoner, Ivan Koludarov, Burkhard Rost bioRxiv 2025.04.22.650077; doi: https://doi.org/10.1101/2025.04.22.650077
Datasets and supplementary data are available on Zenodo:
🔧 CLI Commands
FlatProt provides four main commands:
flatprot project- Create 2D SVG projections from protein structuresflatprot align- Align protein structures using rotationflatprot overlay- Create overlay visualizations from multiple structuresflatprot split- Extract and align structural regions for comparison
See the CLI documentation for detailed usage.
🔄 Common Workflows
Note: The following examples assume you've installed FlatProt with uv tool add FlatProt. If you're using the no-install option, replace flatprot with uvx flatprot in all commands.
Single Structure Visualization
# AlphaFold structures (recommended - no preprocessing needed!)
flatprot project AF-P69905-F1-model_v4.cif --output protein_2d.svg
# Traditional PDB/CIF files (requires DSSP preprocessing)
mkdssp your_protein.cif your_protein_with_dssp.cif
flatprot project your_protein_with_dssp.cif --output protein_2d.svg
Aligned Structure Visualization
# 1. Find optimal family alignment
flatprot align protein.cif -m alignment_matrix.npy
# 2. Create aligned 2D projection
flatprot project protein.cif --matrix alignment_matrix.npy -o aligned_protein.svg
Family Comparison Workflow
# 1. Find optimal alignment for family
flatprot align reference_protein.cif -i family_info.json
# 2. Extract family ID from results
family_id=$(jq -r '.best_hit.target_id' family_info.json)
# 3. Create conserved overlay using fixed family ID
flatprot overlay "family_proteins/*.cif" --family "$family_id" -o family_overlay.png
Domain Analysis Workflow
# 1. Create full structure view
flatprot project protein.cif -o full_structure.svg
# 2. Extract and align specific domains
flatprot split protein.cif --regions "A:1-100,A:150-250" --show-database-alignment -o domains.svg
# 3. Create domain overlay for comparison
flatprot overlay "domain_structures/*.cif" --family 3000114 -o domain_comparison.png
Custom Alignment Workflow
# 1. Generate alignment matrix from first structure
flatprot align reference.cif -m alignment_matrix.npy
# 2. Apply same alignment to all structures
for file in *.cif; do
flatprot project "$file" --matrix alignment_matrix.npy -o "aligned_${file%.cif}.svg"
done
License
FlatProt is licensed under the Apache License 2.0. See the LICENSE file for more details.
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 flatprot-2.4.8.tar.gz.
File metadata
- Download URL: flatprot-2.4.8.tar.gz
- Upload date:
- Size: 28.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f7dc5f2fb203add0c63d25fb878e0496a9c45d8c0e8e32cde776ca98047702b
|
|
| MD5 |
e7a929561e01eef12ff1b3b53844a5a5
|
|
| BLAKE2b-256 |
3a6a496ce731f72a616a6e77ade9758d095192e1d8f65015a5147ef3f7deade3
|
Provenance
The following attestation bundles were made for flatprot-2.4.8.tar.gz:
Publisher:
release.yml on t03i/FlatProt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flatprot-2.4.8.tar.gz -
Subject digest:
2f7dc5f2fb203add0c63d25fb878e0496a9c45d8c0e8e32cde776ca98047702b - Sigstore transparency entry: 259650739
- Sigstore integration time:
-
Permalink:
t03i/FlatProt@b085c299d0ddaa7dbc2c096e984b1ea82b04faea -
Branch / Tag:
refs/tags/v2.4.8 - Owner: https://github.com/t03i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b085c299d0ddaa7dbc2c096e984b1ea82b04faea -
Trigger Event:
push
-
Statement type:
File details
Details for the file flatprot-2.4.8-py3-none-any.whl.
File metadata
- Download URL: flatprot-2.4.8-py3-none-any.whl
- Upload date:
- Size: 141.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d6e139eba731693667246eae9d443903612abbee1a3eb44765ed14e8495ade
|
|
| MD5 |
02214833fe9232dd9aa1ebecd393aa29
|
|
| BLAKE2b-256 |
3fcdf94b15bcd96b4aa64dd89df4128e2ccf95896272e768a279095c51f73869
|
Provenance
The following attestation bundles were made for flatprot-2.4.8-py3-none-any.whl:
Publisher:
release.yml on t03i/FlatProt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flatprot-2.4.8-py3-none-any.whl -
Subject digest:
a2d6e139eba731693667246eae9d443903612abbee1a3eb44765ed14e8495ade - Sigstore transparency entry: 259650741
- Sigstore integration time:
-
Permalink:
t03i/FlatProt@b085c299d0ddaa7dbc2c096e984b1ea82b04faea -
Branch / Tag:
refs/tags/v2.4.8 - Owner: https://github.com/t03i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b085c299d0ddaa7dbc2c096e984b1ea82b04faea -
Trigger Event:
push
-
Statement type: