Welcome to my Master Thesis/ recently upgraded version of my Master Thesis without proprietary dependencies! I took this rather old code base to get used to molecule manipulation, python SQL coding, FastAPI ASGI routing and some front end basics. It is a huge learning opportunity for me. The main reason is that I don't want to lose my chemistry knowledge, and combining it with computer science is the best thing happening right now. Since Docker is the modern way to go, I provide three possible setups: With Docker (easy), Without Docker (Linux), Without Docker (Windows)
The world of computational molecule manipulation in 2026 is in a very advanced, if not, near perfect state. Also protein manipulations are covered to a near perfect state, just look at FASTA and the whole field of possible computations and software available. But peptide manipulations are in a tough spot. Why?
- Molecules and proteins have a predefined alphabet (atoms and the natural amino acids, respectively), where all sorts of computation matrices can be computed beforehand. Peptides on the other hand, which use unnatural amino acids (d-amino acids, chemically modified, etc.) do not have any structual limits, apart of chemical feasability. This makes it impossible to calculate any matrices like BLOSUM.
- Also, while you have SMILES for molecules and FASTA for proteins, peptides are too large to be saved as SMILES, and FASTA isn't able to depict unnatural amino acids. Certain deptictions were developed to capture that sweetspot to convey full structural information:
- This made me interested in programming a website to
- Create peptides from a database of amino acids, or "Monomers", in an editor
- Create new monomers for these peptides
- [Future] : Compare peptides inside an assay and compute physicochemical properties (
$logD$ , isoelectric point, etc.)
Reinventing the wheel is not the way to go. I researched existing libraries to help me accelerate the development.
- React with Vite: Component-based architecture with HMR
- Mantine: UI Components
- Ketcher: Molecule Structure Editor developed by EPAM
- RDKit-js: Molecular Structure Representation as SVGs
- FastAPI: Modern ASGI framework
- uvicorn: ASGI server implementation
- Pydantic: Data validation library
- SQLAlchemy with SQLite: ORM
- RDKit: Cheminformatics tool for the manipulation of molecules
git clone https://github.com/Hebelag/peptide_optimizer.git
cd peptide_optimizer
The both Dockerfiles for backend and frontend already account for downloading the monomers (as written in Section "without Docker") and executing the initialize_database.py.
docker-compose up --build
Backend: http://localhost:8000
Frontend: http://localhost:5173
API endpoints: http://localhost:8000/docs
- Change to the backend folder (
cd backend) python -m venv .venv- Activate environment:
.\\.venv\Scripts\activate(You will see your powershell has a green "(venv)" prefix now) - Install all libraries:
pip install -e .
- Click this link to download ALL 40k+ monomers of the wwPDB (Size zip:28MB; Unzipped: 150MB as of Nov.2025)
- wwPDB-Link (Don't worry, no actual website will open, it will start the download immediately)
- Unzip and move the file (components-pub.sdf) to the
/backend/data/monomersfolder
- With the venv started in Step #2, execute
python \src\database\initialize_db.py
- Change to the frontend folder (
cd ..->cd frontend) npm install
chmod +x startServer.sh && ./startServer.sh
./startServer.bat
- [Critical] Starting from MonomerEditor: Switching in the Navbar to PeptideEditor and Back results in MonomerEditor not finding the saved instance of KetcherEditor
Last updated: Feb 17th, 2026