Skip to content

Commit

Permalink
provides a running blackbox for Rosetta (#222)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Bartels <[email protected]>
Co-authored-by: Miguel González Duque <[email protected]>
Co-authored-by: Richard Michael <[email protected]>
Co-authored-by: Richard Michael <[email protected]>
  • Loading branch information
5 people authored Nov 7, 2024
1 parent f9709e5 commit 1fd2c0b
Show file tree
Hide file tree
Showing 15 changed files with 9,310 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-tox-testing-rosetta-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: poli rosetta (conda, py3.9)

on:
push:
branches:
- dev
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review, closed]
branches:
- dev
- master
schedule:
- cron: '0 0 * * 0'

jobs:
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 8
if: github.event.pull_request.draft == false
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
python -m pip install tox
- name: Test rosetta-related black boxes with tox and pytest
run: |
tox -c tox.ini -e poli-rosetta_energy-py310
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ authors:
- family-names: "Michael"
given-names: "Richard"
title: "poli: a libary of discrete sequence objectives"
version: 1.0.1
version: 1.1.0
date-released: 2024-01-23
url: "https://github.com/MachineLearningLifeScience/poli"
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "poli-core"
version = "1.0.1"
version = "1.1.0"
description = "poli, a library of discrete objective functions"
readme = "README.md"
authors = [{name="Miguel González-Duque", email="[email protected]"}, {name="Simon Bartels", email="[email protected]"}]
Expand Down Expand Up @@ -57,6 +57,10 @@ dockstring = [
rmf = [
"scipy",
]
rosetta_energy = [
"biopython",
"pyrosetta",
]
dev = ["black", "tox", "pytest", "bump-my-version"]
docs = ["sphinx", "furo"]

Expand All @@ -72,6 +76,7 @@ markers = [
"poli__protein: marks tests that run in the poli__protein environment",
"poli__rasp: marks tests that run in the poli__rasp environment",
"poli__rmf: marks tests that run in poli__rmf environment",
"poli__rosetta_energy: marks tests that run in poli__rosetta_energy",
"poli__ehrlich_holo: marks tests that run in poli__ehrlich_holo environment",
"unmarked: All other tests, which usually run in the base environment",
]
Expand All @@ -83,7 +88,7 @@ profile = "black"
exclude = ["src/poli/core/util/proteins/rasp/inner_rasp", "src/poli/objective_repository/gfp_cbas"]

[tool.bumpversion]
current_version = "1.0.1"
current_version = "1.1.0"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = poli-core
version = "1.0.1"
version = "1.1.0"
author = Miguel González-Duque
author_email = [email protected]
description = A library of discrete objective functions
Expand Down
2 changes: 1 addition & 1 deletion src/poli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""poli, a library for discrete black-box objective functions."""

__version__ = "1.0.1"
__version__ = "1.1.0"
from .core.util.isolation.instancing import instance_function_as_isolated_process

# from .core import get_problems
Expand Down
3 changes: 3 additions & 0 deletions src/poli/objective_repository/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
)
from .rfp_rasp.register import RFPRaspBlackBox, RFPRaspProblemFactory
from .rmf_landscape.register import RMFBlackBox, RMFProblemFactory
from .rosetta_energy.register import RosettaEnergyBlackBox, RosettaEnergyProblemFactory
from .sa_tdc.register import SABlackBox, SAProblemFactory
from .scaffold_hop.register import ScaffoldHopBlackBox, ScaffoldHopProblemFactory
from .sitagliptin_mpo.register import (
Expand Down Expand Up @@ -142,6 +143,7 @@
"rfp_foldx_stability": RFPFoldXStabilityProblemFactory,
"rfp_foldx_stability_and_sasa": RFPFoldXStabilityAndSASAProblemFactory,
"rmf_landscape": RMFProblemFactory,
"rosetta_energy": RosettaEnergyProblemFactory,
"sa_tdc": SAProblemFactory,
"super_mario_bros": SuperMarioBrosProblemFactory,
"white_noise": WhiteNoiseProblemFactory,
Expand Down Expand Up @@ -190,6 +192,7 @@
"rfp_foldx_stability": RFPFoldXStabilityBlackBox,
"rfp_foldx_stability_and_sasa": FoldXStabilityAndSASABlackBox,
"rmf_landscape": RMFBlackBox,
"rosetta_energy": RosettaEnergyBlackBox,
"sa_tdc": SABlackBox,
"super_mario_bros": SuperMarioBrosBlackBox,
"white_noise": WhiteNoiseBlackBox,
Expand Down
8,368 changes: 8,368 additions & 0 deletions src/poli/objective_repository/rosetta_energy/1ggx.pdb

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/poli/objective_repository/rosetta_energy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This black-box function uses PyRosetta-4.

Created at JHU by Sergey Lyskov and the PyRosetta Team.

(C) Copyright remains with the Rosetta Commons Member Institutions.


By using the `rosetta_energy` black-box you agree that you have read and are in compliance with the PyRosetta
license agreement.

See LICENSE.PyRosetta.md or email [email protected].
Empty file.
12 changes: 12 additions & 0 deletions src/poli/objective_repository/rosetta_energy/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: poli__rosetta_energy
channels:
- defaults
- conda-forge
- https://conda.rosettacommons.org
dependencies:
- python=3.10
- pyrosetta
- pip:
- numpy
- "git+https://github.com/MachineLearningLifeScience/poli.git@dev"
- biopython==1.72
15 changes: 15 additions & 0 deletions src/poli/objective_repository/rosetta_energy/information.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import numpy as np

from poli.core.black_box_information import BlackBoxInformation
from poli.core.util.proteins.defaults import AMINO_ACIDS

rosetta_energy_information = BlackBoxInformation(
name="rosetta_energy",
max_sequence_length=np.inf,
alphabet=AMINO_ACIDS,
aligned=True,
fixed_length=True,
discrete=True,
deterministic=False,
padding_token="",
)
Loading

0 comments on commit 1fd2c0b

Please sign in to comment.