Skip to content

Commit

Permalink
Better requirements + rename command to chai-lab (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
wukevin authored Feb 14, 2025
1 parent c3a2d15 commit d56a8af
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"--memory=1000g"
],
"shutdownAction": "none",
"postCreateCommand": "uv pip install -e . && pre-commit install -f",
// This contains a separate requirements file for devcontainer specific packages e.g. ruff
"postCreateCommand": "uv pip install -e . && uv pip install -r requirements.dev && pre-commit install -f",
"customizations": {
"vscode": {
"settings": {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
pip install --no-deps uv -r <( cat requirements.in | grep torch) --extra-index-url https://download.pytorch.org/whl/cpu
# install requirements, except torch and potentially nvidia-related stuff
uv pip install --system -r <( cat requirements.in | grep -v nvidia | grep -v torch )
uv pip install --system -r requirements.dev
uv pip install --system --no-deps -e .
- name: Run mypy
run: mypy .
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
pip install --no-deps uv -r <( cat requirements.in | grep torch) --extra-index-url https://download.pytorch.org/whl/cpu
# install requirements, except torch and potentially nvidia-related stuff
uv pip install --system -r <( cat requirements.in | grep -v nvidia | grep -v torch )
uv pip install --system -r requirements.dev
uv pip install --system --no-deps -e .
- name: Run pytest
run: pytest ./tests/
2 changes: 1 addition & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Run pre-commit checks on all files
# run specific ruff pre-commit hooks on all files
run: >
pip install pre-commit
pip install -r requirements.dev
&& pre-commit install -f
&& pre-commit run ruff --all-files
&& pre-commit run ruff-format --all-files
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ This Python package requires Linux, and a GPU with CUDA and bfloat16 support. We

You can fold a FASTA file containing all the sequences (including modified residues, nucleotides, and ligands as SMILES strings) in a complex of interest by calling:
```shell
chai fold input.fasta output_folder
chai-lab fold input.fasta output_folder
```

By default, the model generates five sample predictions, and uses embeddings without MSAs or templates. For additional information about how to supply MSAs, templates, and restraints to the model, see the documentation below, or run `chai fold --help`.
By default, the model generates five sample predictions, and uses embeddings without MSAs or templates. For additional information about how to supply MSAs, templates, and restraints to the model, see the documentation below, or run `chai-lab fold --help`.

For example, to run the model with MSAs (which we recommend for improved performance), pass the `--use-msa-server` and `--use-templates-server` flags:

```shell
chai fold --use-msa-server --use-templates-server input.fasta output_folder
chai-lab fold --use-msa-server --use-templates-server input.fasta output_folder
```

If you are hosting your own ColabFold server, additionally pass the `--msa-server` flag with your server:

```shell
chai fold --use-msa-server --msa-server-url "https://api.internalcolabserver.com" input.fasta output_folder
chai-lab fold --use-msa-server --msa-server-url "https://api.internalcolabserver.com" input.fasta output_folder
```

We also provide additional utility functions for tasks such as MSA file format conversion; see `chai --help` for details.
Expand Down
2 changes: 1 addition & 1 deletion examples/msas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ aligned_pqt.head()

## Additional MSA generation strategies

Multiple strategies can be used for generating MSAs. In our [technical report](https://chaiassets.com/chai-1/paper/technical_report_v1.pdf), we generated MSAs using [jackhmmer](https://github.com/EddyRivasLab/hmmer). Other algorithms such as [MMseqs2](https://github.com/soedinglab/MMseqs2) can also be used. In this vein, we provide support for automatic MSA generation via the [ColabFold](https://github.com/sokrypton/ColabFold) server using `chai fold input.fasta output_directory --msa-server` or by invoking `run_inference` as follows:
Multiple strategies can be used for generating MSAs. In our [technical report](https://chaiassets.com/chai-1/paper/technical_report_v1.pdf), we generated MSAs using [jackhmmer](https://github.com/EddyRivasLab/hmmer). Other algorithms such as [MMseqs2](https://github.com/soedinglab/MMseqs2) can also be used. In this vein, we provide support for automatic MSA generation via the [ColabFold](https://github.com/sokrypton/ColabFold) server using `chai-lab fold input.fasta output_directory --msa-server` or by invoking `run_inference` as follows:

```python
candidates = run_inference(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ exclude = [
# should use packages from sdist section

[project.scripts]
chai = "chai_lab.main:cli"
chai-lab = "chai_lab.main:cli"
6 changes: 6 additions & 0 deletions requirements.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# dev-deps
pre-commit
ruff==0.6.3 # in sync with pre-commit-hook
mypy
pytest
ipykernel~=6.27 # needed by vs code to run notebooks in devcontainer
8 changes: 0 additions & 8 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# dev-deps, still placed in the same requirements file
ruff==0.6.3 # in sync with pre-commit-hook
mypy
pytest
pre-commit

# types/stubs are required by mypy
pandas-stubs
types-pyyaml
Expand All @@ -15,8 +9,6 @@ types-requests
typer~=0.12 # CLI generator
# pydantic~=2.5 # serialization/deserialization of configs

# notebooks, plotting
ipykernel~=6.27 # needed by vs code to run notebooks in devcontainer
# seaborn
matplotlib

Expand Down

0 comments on commit d56a8af

Please sign in to comment.