Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 8 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
**/.git
**/venv
**/.venv
**/.mypy_cache
**/.pytest_cache
**/node_modules
**/.vscode
**/.vscode
.boltz/
backend/notebooks/
backend/folde/data/
backend/foldydata/
86 changes: 86 additions & 0 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Frontend Tests

on:
push:
branches: [ main, master ]
paths:
- 'frontend/**'
pull_request:
branches: [ main, master ]
paths:
- 'frontend/**'

jobs:
test:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./frontend

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: ./frontend/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint || echo "Linting failed, continuing with tests"
continue-on-error: true

- name: Run tests with coverage
run: npm run test:coverage

- name: Upload test coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./frontend/coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./frontend/coverage/lcov.info
flags: frontend
fail_ci_if_error: false

build:
runs-on: ubuntu-latest
needs: test

defaults:
run:
working-directory: ./frontend

steps:
- uses: actions/checkout@v3

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: ./frontend/package-lock.json

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: ./frontend/dist
51 changes: 51 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Python CI

on:
push:
branches: [ main, master ]
paths:
- 'backend/**'
pull_request:
branches: [ main, master ]
paths:
- 'backend/**'

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend

strategy:
matrix:
python-version: [3.12]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov

- name: Run mypy type checker
run: |
mypy app

- name: Run pytest with coverage
run: |
pytest app/tests --cov=app --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./backend/coverage.xml
flags: backend
fail_ci_if_error: false
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,8 @@ dmypy.json
# Pyre type checker
.pyre/

.vscode

# Secrets
cluster_config.yaml
cluster_config.yamlok
config.yaml
prod_secrets.yaml
dev_secrets.env
Expand All @@ -142,3 +140,20 @@ db_creation_resources.yaml
# Frontend files.
**/node_modules
**/secrets

# Generally don't commit the local directory for foldy
backend/notebooks/jacob/data/*
backend/notebooks/jacob/sarah/*
backend/notebooks/jacob/flip-aav.csv
backend/folde/data/*
backend/foldydata/*
.boltz/

backend/EvolveTest

CLAUDE.md
CLAUDE_NOTES.md

**/.claude/settings.local.json

frontend/stats.html
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "worker/alphafold"]
path = worker/alphafold
url = git@github.com:JBEI/alphafold.git
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
exclude: ^deployment/helm/templates/
- id: check-added-large-files
args: ['--maxkb=102400'] # 100MB in kilobytes


- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.400
hooks:
- id: pyright
files: ^backend/

- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
name: isort (python)
files: ^backend/

- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
language_version: python3
files: ^backend/
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"detachhead.basedpyright",
"ms-python.python",
"ms-tools.vscode-jupyter-notebooks",
]
}
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"editor.formatOnSave": true,
"python.formatting.provider": "none",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"jupyter.notebookFileRoot": "${workspaceFolder}/backend",
"files.exclude": {
"**/.git": false
},
"python.analysis.typeCheckingMode": "off",
"python.analysis.autoImportCompletions": true,
"python.analysis.extraPaths": [
"\"${workspaceFolder}/backend\""
],
"python.languageServer": "None",
"python.pythonPath": "./.venv/bin/python",
"editor.detectIndentation": false,
"docker.enableDockerComposeLanguageService": false,
"cursor.general.disableHttp2": true,
}
// BasedPyright settings in vscode are ignored when using pyrightconfig.json is provided.
9 changes: 4 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Foldy Copyright (c) 2023, The Regents of the University of California,
Foldy Copyright (c) 2023 to 2025, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject to receipt of
any required approvals from the U.S. Dept. of Energy) and University
of California, Berkeley. All rights reserved.
Expand All @@ -14,9 +14,9 @@ notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

(3) Neither the name of the University of California, Lawrence Berkeley
National Laboratory, U.S. Dept. of Energy, University of California,
Berkeley, nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written
National Laboratory, U.S. Dept. of Energy, University of California,
Berkeley, nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written
permission.


Expand All @@ -42,4 +42,3 @@ non-exclusive, royalty-free perpetual license to install, use, modify,
prepare derivative works, incorporate into other computer software,
distribute, and sublicense such enhancements or derivative works thereof,
in binary and source code form.

74 changes: 51 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
<div align="center">

# Foldy

<p align="center">
Foldy is a webtool for doing computational structural biology, centered around protein structure prediction with AlphaFold.
</p>
<p align="center">
<img src="frontend/public/pksito.gif" width="400" height="400" />
</p>
**Run Boltz, DiffDock, ESM, and FolDE locally through a simple web interface.**

<img src="frontend/public/pksito.gif" width="200" height="200" />

</div>

Protein design tools like Boltz, DiffDock, and ESM are powerful but difficult to install and run. Foldy wraps them in a Docker-based interface so you can focus on your science instead of debugging environments.

**What you can do:**
- Predict protein structures and binding affinities with Boltz
- Dock small molecules with DiffDock
- Get protein language model predictions from ESM
- Run protein engineering campaigns via FolDE

**[Click here for quick setup →](deployment/local/README.md)**

## Deployment Options

Foldy is a composable set of services which can be deployed lots of ways. We currently document three types of deployment: Development, Foldy-in-a-Box, and Helm. The development deployment is not fully featured - it cannot run jobs - but supports the frontend features and it can easily be run on a laptop for development purposes. Foldy-in-a-box is a quick deployment option - it can be run in under ten minutes - for creating a full featured Foldy instance on a Google Cloud machine. It could also be the starting point for a more bespoke deployment on a large local machine. Finally the Helm deployment is the horizontally scalable, cloud deployment, built on Kubernetes. The name comes from Helm Charts, which are a tool for specifying Kubernetes deployments. The Helm deployment is involved, but it is secure and can be scaled to hundreds of users and tens of thousands of folds.
Foldy is a composable set of services which can be deployed lots of ways. We currently document four types of deployment: Local, Development, and Helm. The Local deployment runs Foldy with a single command using pre-built Docker images - no git clone required. The Development deployment is not fully featured - it cannot run jobs - but supports the frontend features and can easily be run on a laptop for development purposes. Foldy-in-a-box is a quick deployment option for creating a full featured Foldy instance on a Google Cloud machine. Finally, the Helm deployment is the horizontally scalable, cloud deployment built on Kubernetes. The Helm deployment is involved, but it is secure and can be scaled to hundreds of users and tens of thousands of folds.

You can find more information about employing the different deployment options in their respective `deployment` directories.

|Deployment Type|Features|Ease of setup|Setup|
|Deployment Type|Description|Ease of setup|Setup|
|---|---|---|---|
|Development|No tools, just an interface|Extremely easy|[Instructions](deployment/development/README.md)|
|Foldy-in-a-Box|All tools can run|Easy|[Instructions](deployment/foldy-in-a-box/README.md)|
|Local|Full featured, single command|Very easy|[Instructions](deployment/local/README.md)|
|Development|Run locally when making code changes|Extremely easy|[Instructions](deployment/development/README.md)|
|Helm|Scalable to hundreds of users|Hard|[Instructions](deployment/helm/README.md)|

## The Interface
Expand All @@ -33,17 +44,35 @@ There is a rich ecosystem for running structural biology tools, and Foldy is not

## Acknowledgements

Foldy utilizes many separate libraries and packages including:
Foldy is built on the work of many open-source projects and databases. We are grateful to the developers and maintainers of:

- [Alphafold](https://github.com/deepmind/alphafold)
- [Autodock Vina](https://vina.scripps.edu/)
- [Pfam](https://www.ebi.ac.uk/interpro/)
- [NGL Viewer](https://nglviewer.org)
- [HMMER Suite](http://eddylab.org/software/hmmer)
- [Flask](https://flask.palletsprojects.com/en/2.2.x/)
- [Plotly](https://github.com/plotly/plotly.js)
### Structure Prediction & Modeling
- [AlphaFold](https://github.com/deepmind/alphafold) - Deep learning system for protein structure prediction
- [Boltz](https://github.com/jwohlwend/boltz) - Generative protein–ligand interaction modeling
- [ESM2](https://github.com/facebookresearch/esm) - Evolutionary Scale Modeling protein language models (Meta FAIR)
- [ESM C](https://github.com/evolutionaryscale/esm) - Protein representation models (EvolutionaryScale)

We thank all their contributors and maintainers!
### Molecular Docking
- [AutoDock Vina](https://github.com/ccsb-scripps/AutoDock-Vina) - Molecular docking and virtual screening (CCSB/Scripps Research)
- [DiffDock](https://github.com/gcorso/DiffDock) - Diffusion-based molecular docking

### Protein Domain Analysis
- [Pfam Database](https://www.ebi.ac.uk/interpro/entry/pfam/) - Protein families database (EMBL-EBI InterPro)
- [PfamScan](https://github.com/ebi-pf-team/PfamScan) - Tool for scanning sequences against Pfam HMMs
- [HMMER Suite](http://eddylab.org/software/hmmer) - Biosequence analysis using profile hidden Markov models

### Visualization
- [Mol*](https://github.com/molstar/molstar) - Macromolecular 3D visualization library (PDBe/EMBL-EBI & RCSB PDB)

### Cheminformatics
- [RDKit](https://github.com/rdkit/rdkit) - Cheminformatics and machine learning toolkit

### Web Framework & Libraries
- [Flask](https://flask.palletsprojects.com/) - Python web framework
- [Plotly](https://github.com/plotly/plotly.js) - Interactive graphing library
- [PyTorch](https://github.com/pytorch/pytorch) - Machine learning framework

We thank all contributors and maintainers of these projects!

Use of the third-party software, libraries or code Foldy may be governed by separate terms and conditions or license provisions. Your use of the third-party software, libraries or code is subject to any such terms and you should check that you can comply with any applicable restrictions or terms and conditions before use.

Expand All @@ -53,9 +82,9 @@ Foldy is distributed under a modified BSD license (see LICENSE).

## Copyright Notice

Foldy Copyright (c) 2023, The Regents of the University of California,
Foldy Copyright (c) 2023 to 2025, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject to receipt of
any required approvals from the U.S. Dept. of Energy) and University
any required approvals from the U.S. Dept. of Energy) and University
of California, Berkeley. All rights reserved.

If you have questions about your rights to use or distribute this software,
Expand All @@ -66,6 +95,5 @@ NOTICE. This Software was developed under funding from the U.S. Department
of Energy and the U.S. Government consequently retains certain rights. As
such, the U.S. Government has been granted for itself and others acting on
its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the
Software to reproduce, distribute copies to the public, prepare derivative
Software to reproduce, distribute copies to the public, prepare derivative
works, and perform publicly and display publicly, and to permit others to do so.

4 changes: 3 additions & 1 deletion backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
venv
venv
notebooks/
folde/data/
Loading
Loading