Skip to content

Commit

Permalink
Make recently new cif_output arguments optional, do not break existin…
Browse files Browse the repository at this point in the history
…g code

Colab notbook was broken by this change and potentially code of other users
as well. Keep backward compatibility by also allowing the old way.
  • Loading branch information
vaclavhanzl committed Apr 25, 2023
1 parent b95099b commit feb9993
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion openfold/np/relax/relax.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
self._use_gpu = use_gpu

def process(
self, *, prot: protein.Protein, cif_output: bool
self, *, prot: protein.Protein, cif_output: bool = False
) -> Tuple[str, Dict[str, Any], np.ndarray]:
"""Runs Amber relax on a prediction, adds hydrogens, returns PDB string."""
out = amber_minimize.run_pipeline(
Expand Down
4 changes: 2 additions & 2 deletions openfold/utils/script_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def prep_output(out, batch, feature_dict, feature_processor, config_preset, mult
return unrelaxed_protein


def relax_protein(config, model_device, unrelaxed_protein, output_directory, output_name, cif_output):
def relax_protein(config, model_device, unrelaxed_protein, output_directory, output_name, cif_output=False):
amber_relaxer = relax.AmberRelaxation(
use_gpu=(model_device != "cpu"),
**config.relax,
Expand Down Expand Up @@ -257,4 +257,4 @@ def relax_protein(config, model_device, unrelaxed_protein, output_directory, out
with open(relaxed_output_path, 'w') as fp:
fp.write(struct_str)

logger.info(f"Relaxed output written to {relaxed_output_path}...")
logger.info(f"Relaxed output written to {relaxed_output_path}...")

0 comments on commit feb9993

Please sign in to comment.