Coder Social home page Coder Social logo

rfdesign's People

Contributors

javierbq avatar jueseph avatar sanaamansoor avatar timodonnell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rfdesign's Issues

Blank PDB?

Doing some tests on a different structure with a receptor. Contigs are: 'A219-585,5-10,A588-735,0,R144-237'
I'm writing 5 structures.

These are PDB numbers as it seems that they are OK to use?
For the 0th structure, I get a blank PDB. What does this indicate?

missing compile_metrics.py file

Hi,
Was trying to reproduce the data using Tutorial: Hallucinating PD-L1 binder. But I think the compile_metrics.py is missing in the scripts folder.

psipred4 missing

When I calculate Rosetta interface metrics by running sbatch --mem 5g --wrap "../../scripts/get_interface_metrics.py output/run2/trf_relax/"

I get sh: /software/psipred4/runpsipred_single: No such file or directory

How can I install psipred4?

ModuleNotFoundError: No module named 'tree'

Hi,

When I want to run the script af2_metrics.py, I get the following ModuleNotFoundError:

Traceback (most recent call last): File "/sw/sci/app/rfdesign/RFDesign/scripts/af2_metrics.py", line 34, in <module> from alphafold.common import protein File "/sw/sci/app/rfdesign/RFDesign/scripts/../hallucination/models/alphafold/alphafold/common/protein.py", line 19, in <module> from alphafold.common import residue_constants File "/sw/sci/app/rfdesign/RFDesign/scripts/../hallucination/models/alphafold/alphafold/common/residue_constants.py", line 22, in <module> import tree ModuleNotFoundError: No module named 'tree'

The environment was set up from the .yml, but I looks like this module is not included.

Best,
Jakob

DAlphaBall missing

When running the get_interface_metrics.py? I get the following error

sh: /software/rosetta/DAlphaBall.gcc: No such file or directory
sh: /software/rosetta/DAlphaBall.gcc: No such file or directory
From where should Iget the DAlphaBall?

Type Error with af2_interface_metrics.py

Hi,
First of all, I am really not that familiar with Jax. My conda environment was built with distributed yml file and thus got the Jax 0.3.24 as shown below.
jax 0.3.24 pypi_0 pypi
jaxlib 0.3.24 pypi_0 pypi

However, when running the af2_interface_metrics with the silent files, I am getting the following error. Any thoughts on this? I am getting the same error when using both AF 2.3.1 and AF 2.2.4 versions. Also, af2_metrics.py works without any issue.

Traceback (most recent call last):
File "/software/RFDesign2/scripts/af2_interface_metrics.py", line 597, in
predict_structure(tag_buffer, feature_dict_dict, binderlen_dict, initial_guess_dict, sfd_out, scorefilename)
File "/software/RFDesign2/scripts/af2_interface_metrics.py", line 431, in predict_structure
prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params,
File "/software/RFDesign2/envs/.conda/envs/rfdesign2/lib/python3.9/site-packages/haiku/_src/transform.py", line 128, in apply_fn
out, state = f.apply(params, {}, *args, **kwargs)
File "/software/RFDesign2/envs/.conda/envs/rfdesign2/lib/python3.9/site-packages/haiku/_src/transform.py", line 357, in apply_fn
out = f(*args, **kwargs)
TypeError: _forward_fn() takes 1 positional argument but 2 were given

Appreciate it a lot.
Thanks!

index out of range

Hi developers,

when i use this command:
python /home/yanx/Dev/repos/RFDesign/inpainting/inpaint.py --task hal --checkpoint v02 --pdb=/home/yanx/Dev/workdir/XX/RFDesignRes/XX-chainD.pdb --out=/home/yanx/Dev/workdir/XX/RFDesignRes --window D,15,20:D,84,95 --num_designs 1 --inf_method=multi_shot --n_iters 10 --recycle_str_mode both --clamp_1d 0.1 --dump_all

i got the following problem:

Generating design 0 (1 total)...
Traceback (most recent call last):
File "/home/yanx/Dev/repos/RFDesign/inpainting/inpaint.py", line 837, in
main()
File "/home/yanx/Dev/repos/RFDesign/inpainting/inpaint.py", line 505, in main
sm, mappings, mask_str, mask_seq = pred_util.get_mask(args, parsed_pdb)
File "/home/yanx/Dev/repos/RFDesign/inpainting/pred_util.py", line 123, in get_mask
mask_str = sm.inpaint
File "/home/yanx/Dev/repos/RFDesign/inpainting/dj_util.py", line 207, in inpaint
m_gap = np.isnan(self.ref_pdb_res)
File "/home/yanx/Dev/repos/RFDesign/inpainting/dj_util.py", line 120, in ref_pdb_res
ch, res = zip(*self.ref_pdb_idx)
File "/home/yanx/Dev/repos/RFDesign/inpainting/dj_util.py", line 111, in ref_pdb_idx
return self.expand(self.mask_str)
File "/home/yanx/Dev/repos/RFDesign/inpainting/dj_util.py", line 365, in expand
ch, s, e = SampledMask.parse_element(l)
File "/home/yanx/Dev/repos/RFDesign/inpainting/dj_util.py", line 294, in parse_element
if contig[0].isalpha():
IndexError: string index out of range

Aborted (core dumped) when test the scripts

Hello
When I try to run the example script, the following error is reported when trying to simulate an inpainting operation:

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)

When I try to run hallucination, the following error is reported:

trap: DEBUG: bad trap

We know that errors such as "Aborted (core dumped)" can be difficult to fix.
I added the following command to .bashrc.

ulimit -c unlimited

But it still doesn't work, so I would like to ask if you have any suggestions. Thank you!

Lea

Af2_metrics error

Hi dear Jue

I'm very very interested in your work, That's a great job!
I've designed many sequences with RFDesign.
But i got this error

File "../../scripts/af2_metrics.py", line 369, in trb['con_ref_idx0'] = np.array([idxmap[i] for i in trb['con_ref_pdb_idx']])
KeyError: ('R', 1)

How can i fixed it.
Thank you

Is there any way to provide MSA of receptor for af2_metrics.py ?

Hi,

After design protein binder using hallucination.py, I tried to validate results.

According to the tutorials, first I run the trfold_relax.sh,

and then run the af2_metrics.py .

However, the modeling result was implausible especially in the receptor region.

In the case of my receptor, the modeling result was plausible only if the MSA is provided.

I thought that the implausible result of af2_metrics.py might be originated from the modeling without MSA.

So, is there any protocol or alternative way to validate my result ?

Sincerely,
jongseo

Missing rosetta flags and xml script for relaxation in SH3 tutorial

Been doing a local install and going through the SH3 tutorial.
I am stuck at the relaxation step after getting AF2 interface metrics:

/home/nrbennet/rosetta_builds/tutorial_build/main/source/cmake/build_release/rosetta_scripts \ 
@/home/nrbennet/protocols/flags/relax/relax.flags \ 
-parser:protocol \
/home/nrbennet/protocols/xml/relax/min/minterface.xml

Does the repo contain the flags @/home/nrbennet/protocols/flags/relax/relax.flags and the XML script /home/nrbennet/protocols/xml/relax/min/minterface.xml required to run this relaxation?

Would it be possible to provide these for the tutorial or is there another way to "complete" the tutorial?

Not found /software/rosetta/DAlphaBall.gcc

In line 32 of the scripts/get_interface_metrics.py , as follows:
init('-corrections::beta_nov16 -holes:dalphaball /software/rosetta/DAlphaBall.gcc -detect_disulf false')

What file is/software/rosetta/DAlphaBall.gcc here? I did not find it in the Rosetta source code.

Multiple ModuleNotFoundError

Hi,

similar to issue 22, when I want to run the script af2_metrics.py, I get the following ModuleNotFoundError:

Traceback (most recent call last):
  File "/home/kieran/RFDesign/hallucination/tests/../../scripts/af2_metrics.py", line 34, in <module>
    from alphafold.common import protein
  File "/home/kieran/RFDesign/scripts/../hallucination/models/alphafold/alphafold/common/protein.py",
   line 20, in <module>
    from Bio.PDB import PDBParser
ModuleNotFoundError: No module named 'Bio'

I also had the tree error from issue 22 before, but this one popped up after I installed tree.

I solved it by running pip install biopython, but for reproducibility, it might be useful to include biopython in the environment file.

After that got another one:

  File "/home/kieran/RFDesign/hallucination/tests/../../scripts/af2_metrics.py", line 35, in <module>
    from alphafold.data import pipeline
  File "/home/kieran/RFDesign/scripts/../hallucination/models/alphafold/alphafold/data/pipeline.py",
   line 19, in <module>
    from absl import logging
ModuleNotFoundError: No module named 'absl'

Fixed this one via pip install absl-py. If I am correct this was not included in the .yaml file either right?

A third one:

Traceback (most recent call last):
  File "/home/kieran/RFDesign/hallucination/tests/../../scripts/af2_metrics.py", line 37, in <module>
    from alphafold.model import data
  File "/home/kieran/RFDesign/scripts/../hallucination/models/alphafold/alphafold/model/data.py", line 20, in <module>
    from alphafold.model import utils
  File "/home/kieran/RFDesign/scripts/../hallucination/models/alphafold/alphafold/model/utils.py", line 21, in <module>
    import haiku as hk
ModuleNotFoundError: No module named 'haiku'

After that quite a few others came up (fixes listed below):

Currently I get the error ModuleNotFoundError: No module named 'simtk.openmm.app.internal'.

Before I continue down the rabbit hole: did I miss some installation files here or are these dependencies just not documented?

All the best,
Kieran

Error while running af2_interface_metrics.py

I've tried af2_interface_metrics.py using /tutorial//halluc_SH3_binder/output/20220104_sh3_r2/trf_relax/00

But, it gave that:

core.chemical.GlobalResidueTypeSet: Total time to initialize 1.19 seconds.
predict_structure(tag_buffer, feature_dict_dict, binderlen_dict, initial_guess_dict, sfd_out, scorefilename)
File "/home1/LJY/rfdesign/RFDesign/scripts/af2_interface_metrics.py", line 433, in predict_structure
prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params,
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/traceback_util.py", line 163, in reraise_with_filtered_traceback
return fun(*args, **kwargs)
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/api.py", line 1770, in vmap_f
out_flat = batching.batch(
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/linear_util.py", line 165, in call_wrapped
ans = self.f(*args, **dict(self.params, **kwargs))
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/traceback_util.py", line 163, in reraise_with_filtered_traceback
return fun(*args, **kwargs)
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/pjit.py", line 237, in cache_miss
outs, out_flat, out_tree, args_flat = _python_pjit_helper(
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/pjit.py", line 180, in _python_pjit_helper
args_flat, _, params, in_tree, out_tree, _ = infer_params_fn(
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/api.py", line 443, in infer_params
return pjit.common_infer_params(pjit_info_args, *args, **kwargs)
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/pjit.py", line 520, in common_infer_params
jaxpr, consts, canonicalized_out_shardings_flat = _pjit_jaxpr(
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/linear_util.py", line 301, in memoized_fun
ans = call(fun, *args)
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/pjit.py", line 932, in _pjit_jaxpr
jaxpr, global_out_avals, consts = pe.trace_to_jaxpr_dynamic(
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/src/profiler.py", line 314, in wrapper
return func(*args, **kwargs)
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/interpreters/partial_eval.py", line 1985, in trace_to_jaxpr_dynamic
jaxpr, out_avals, consts = trace_to_subjaxpr_dynamic(
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/interpreters/partial_eval.py", line 2002, in trace_to_subjaxpr_dynamic
ans = fun.call_wrapped(*in_tracers
)
File "/home/users/LJY/.local/lib/python3.8/site-packages/jax/_src/linear_util.py", line 165, in call_wrapped
ans = self.f(*args, **dict(self.params, **kwargs))
File "/home/users/LJY/.local/lib/python3.8/site-packages/haiku/_src/transform.py", line 128, in apply_fn
out, state = f.apply(params, {}, *args, **kwargs)
File "/home/users/LJY/.local/lib/python3.8/site-packages/haiku/_src/transform.py", line 357, in apply_fn
out = f(*args, **kwargs)
jax._src.traceback_util.UnfilteredStackTrace: TypeError: _forward_fn() takes 1 positional argument but 2 were given

The stack trace below excludes JAX-internal frames.
The preceding is the original exception that occurred, unmodified.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home1/LJY/rfdesign/RFDesign/scripts/af2_interface_metrics.py", line 599, in
predict_structure(tag_buffer, feature_dict_dict, binderlen_dict, initial_guess_dict, sfd_out, scorefilename)
File "/home1/LJY/rfdesign/RFDesign/scripts/af2_interface_metrics.py", line 433, in predict_structure
prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params,
File "/home/users/LJY/.local/lib/python3.8/site-packages/haiku/_src/transform.py", line 128, in apply_fn
out, state = f.apply(params, {}, *args, **kwargs)
File "/home/users/LJY/.local/lib/python3.8/site-packages/haiku/_src/transform.py", line 357, in apply_fn
out = f(*args, **kwargs)
TypeError: _forward_fn() takes 1 positional argument but 2 were given


What can I do for this error?

inpaint cache problem

Hi!

i try to run RFDesign in colab, but i meet some trouble:

in the readme:
"If you are getting output pdbs that are a ball of disconnected segments (as viewed in pymol), this may be due to a problem with the spherical harmonics cached by SE3-transformer. A workaround is to copy the hallucination/cache/ folder (a correct, clean copy of the cache) to your working directory before running hallucinate.py or inpaint.py."

it did not help when running inpaint.py, the output pdb still adisconnected ball.

what i already done:

  • cp -r hallucination/cache ./

by the way, in the se3.yml the icecream is missing.

best,
weikun

Inpainting not using --receptor_chain argument

Inpainting appears to be ignoring the --receptor_chain argument. The receptor chain is not included in the output PDB or .trb files.
Here is an example of designing a 20-residue loop in a heterodimer complex:

python RFDesign/inpainting/inpaint.py --pdb ~/structures/4i0c.pdb --contigs D1-95,20,D116-127 --out ~/output/4i0c_inpainting --receptor_chain A --dump_all

RuntimeError: CUDA out of memory.

Is there a restriction on the AA length of a protein to run RFDesign? I encounter errors using 16GB and 24GB gpus (v100 and a30)

RuntimeError: CUDA out of memory. Tried to allocate 9.36 GiB (GPU 0; 23.55 GiB total capacity; 14.56 GiB already allocated; 6.95 GiB free; 14.96 GiB reserved in total by PyTorch)

Error in running hallucination

Command: python hallucinate.py --pdb=../test/input/4e3b.pdb --mask="A30-40" --out=../test/output/
Output: FileNotFoundError:
Traceback (most recent call last):
File "/projectsp/f_sdk94_1/PDZ_complex/RFDesign/hallucination/hallucinate.py", line 739, in
main()
File "/projectsp/f_sdk94_1/PDZ_complex/RFDesign/hallucination/hallucinate.py", line 273, in main
Net, net_params = optimization.load_structure_predictor(script_dir, args, device)
File "/projectsp/f_sdk94_1/PDZ_complex/RFDesign/hallucination/util/../optimization.py", line 297, in load_structure_predictor
weights = torch.load(chks[0],map_location=torch.device(device))
File "/projectsp/f_sdk94_1/PDZ_complex/RFDesign_env/SE3-nvidia/lib/python3.9/site-packages/torch/serialization.py", line 594, in load
with _open_file_like(f, 'rb') as opened_file:
File "/projectsp/f_sdk94_1/PDZ_complex/RFDesign_env/SE3-nvidia/lib/python3.9/site-packages/torch/serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/projectsp/f_sdk94_1/PDZ_complex/RFDesign_env/SE3-nvidia/lib/python3.9/site-packages/torch/serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
[Errno 2] No such file or directory: '/projectsp/f_sdk94_1/PDZ_complex/RFDesign/hallucination/weights//rf_Nov05/BFF_last.pt'

The weights file BFF_last.pt, which is listed under checkpoints in models.json, does not exist. Is there something I did wrong in my command? Or should this weights file be obtained elsewhere?

RuntimeError: _cdist_backward requires X1 to be contiguous

I have successfully hallucinated various proteins, but every so often I run into the following error: "RuntimeError: _cdist_backward requires X1 to be contiguous" (see picture attached below)

It usually occurs when attempting to hallucinate shorter proteins or use fewer gradient steps. Looking at the job's output file, the job makes it to step 0 of the gradient descent before failing. Has this occurred to anyone else?

image

May run trfold_relax.sh out of slurm possible?

May you be so kind as to provide another version of trfold_relax.sh for local workstations without Slurm. Or simply any tips to modify the script to jump from submitting jobs by sbatch. Thanks for any productive replies!

no PDBs output/NameError: name 'aa_util' is not defined

I'm getting en error where the runs says it completes successfully, but wont output any pdb files.

Example:

python /home/ubuntu/RFDesign/inpainting/inpaint.py --pdb test_linker.pdb --contigs A1-133,0 B134-316,45,B347-553 --out out/45_test --num_designs 1

ic| args: Namespace(pdb='/home/ubuntu/inpaint_test/test_linker.pdb', contigs=['A1-133,0', 'B134-316,31,B347-553'], length=None, checkpoint='/home/ubuntu/RFDesign/inpainting/weights/BFF_mix_epoch25.pt', inpaint_str=None, inpaint_seq=None, n_cycle=4, tmpl_conf='0.5', num_designs=1, res_translate=None, tie_translate=None, floating_points=None, block_rotate=None, verbose=False, out='/home/ubuntu/inpaint_test', dump_pdb=True, dump_trb=False, dump_npz=False, dump_fasta=False, dump_all=False, input_json=None, outdir='/home/ubuntu', prefix='inpaint_test')
On design  0
ic| args.contigs: ['A1-133,0', 'B134-316,31,B347-553']
on cycle 0
on cycle 1
on cycle 2
Successfully wrote output

If I run with the "--verbose" flag, it yields the following:

python /home/ubuntu/RFDesign/inpainting/inpaint.py --pdb test_linker.pdb --contigs A1-133,0 B134-316,45,B347-553 --out out/45_test --num_designs 1 --dump_all --verbose

ic| args: Namespace(pdb='test_linker.pdb', contigs=['A1-133,0', 'B134-316,45,B347-553'], length=None, checkpoint='/home/ubuntu/RFDesign/inpainting/weights/BFF_mix_epoch25.pt', inpaint_str=None, inpaint_seq=None, n_cycle=4, tmpl_conf='0.5', num_designs=1, res_translate=None, tie_translate=None, floating_points=None, block_rotate=None, verbose=True, out='out/45_test', dump_pdb=True, dump_trb=True, dump_npz=True, dump_fasta=True, dump_all=True, input_json=None, outdir='out', prefix='45_test')
On design  0
ic| args.contigs: ['A1-133,0', 'B134-316,45,B347-553']
Traceback (most recent call last):
  File "/home/ubuntu/RFDesign/inpainting/inpaint.py", line 435, in <module>
    main()
  File "/home/ubuntu/RFDesign/inpainting/inpaint.py", line 346, in main
    ic(aa_util.seq2chars(seq))
NameError: name 'aa_util' is not defined

I should also mention that the inpainting tests cmplete successfully and so output a pdb.
Any ideas or pointers would be appreciated.

-Andrew

AF2 Dependencies for af2_metrics.py

SOLUTION TO THIS PROBLEM IS TO COMMENT OUT LINE 40 of does af2_metrics.py that says "from alphafold.relax import relax"
(also discussed in #7)
Hi RFDesign Team,

Thank you very much for sharing RFDesign and providing the tutorials!

I am trying to run the af2_metrics.py script however the SE3-nvidia.yml file does not contain a number of modules required to run it.
So far I have identified the following needing to be installed: dm-tree, biopython, dm-haiku, absl-py, jaxlib, jax, ml_collections, tensorflow
I got up to PDBfixer and its requirement openmm but unfortunately, openmm wouldn't install because of environment conflicts.

I notice that the same issue has been highlighted in issue #7 and so I have tried to install various different correct versions of the different libraries and I have also gone to the alpha fold git repo to identify their requirements.txt folders. Unfortunately, I am still not having any luck with getting the environment conflicts to solve :(

You mentioned in #7 that you were working on a major update to the repo that would solve this env issue but I notice that the SE3-nvidia.yml file still doesn't contain some of the above.

I was wondering if you might be able to update the yml file to build the right conda environment?
Would I then be able to run the conda env -f create SE3-nvidia.yml again and it would overwrite the previous SE3-nvidia env with the new updated one?

Thank you!

no alphafold module in hallucination/models/

The af2_metrics.py requests a module called alphafold in hallucination/models/, but actually there is not such a module. I've copied to hallucination/models/, but there are still some compatible problems(maybe Deepmind updated their work?). Could you please push this module to your repository?

Issue with alphafold-complex predication with initial guess of binder position

I got the following error messages when running af2_interface_metrics.py

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "../../../../../../scripts/af2_interface_metrics.py", line 600, in <module>
    predict_structure(tag_buffer, feature_dict_dict, binderlen_dict, initial_guess_dict, sfd_out, scorefilename)
  File "../../../../../../scripts/af2_interface_metrics.py", line 429, in predict_structure
    prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params, jax.random.PRNGKey(0), processed_feature_dict, processed_initial_guess_dict)
  File "/HOME/scz3220/.conda/envs/rfdesign/lib/python3.8/site-packages/haiku/_src/transform.py", line 127, in apply_fn
    out, state = f.apply(params, {}, *args, **kwargs)
  File "/HOME/scz3220/.conda/envs/rfdesign/lib/python3.8/site-packages/haiku/_src/transform.py", line 354, in apply_fn
    out = f(*args, **kwargs)
TypeError: _forward_fn() takes 1 positional argument but 2 were given

it seems like the current version of alphafold attached in this directory hallucination/models/alphafold/alphafold/ is not compatible with the scripts af2_interface_metrics.py.

May I ask how to modify alphafold scripts to pass initial guess of binders' position? Thanks for sharing this great work! and best wishes~

Hallucination w/ receptor crashing while saving output

Hi,
I have been trying to hallucinate some new designs to bind a particular target. The hallucination script crashes while trying to save the output.
Input command:
python hallucinate.py --pdb antiIL6_shorter_bound.pdb --contigs=A32-33,A55-58,A103-106,A170,A174-178,A212-213,A239-240 --force_aa=A32-33,A55-58,A103-106,A170,A174-178,A212-213,A239-240 --len=125-150 --receptor IL6_Ligand_Shortened_Alpha_CB.pdb --out IL6/IL6 --num=200 --steps=g10 --exclude_aa C --save_pdb=True

Output:
Using CUDA device(s): cuda:0: (NVIDIA GeForce RTX 3080);

Parsing input pdb...
Parsing receptor pdb...

Generating IL6_0, length 201...
Forcing amino acids: A32R,A33Y,A55Y,A56D,A57G,A58D,A103V,A104V,A105T,A106G,A170N,A174G,A175T,A176Y,A177A,A178Y,A212K,A213S,A239N,A240F, and 61 receptor positions
Calculating 100 background distributions...
Loss term | Weight
cce 1.00
entropy 1.00
kl 1.00

Stage 0
Starting gradient descent...
step avg loss cce entropy kl
0 2.7400 5.0881 3.2141 -0.0821
10 2.5137 4.5615 3.0856 -0.1060
final 2.4549 4.3876 3.1224 -0.1454
best loss step: 1
Max CUDA memory: 6.4923G
Saving /home/paul/RFDesign/hallucination/IL6/IL6_0: Traceback (most recent call last):
File "/home/paul/RFDesign/hallucination/hallucinate.py", line 739, in
main()
File "/home/paul/RFDesign/hallucination/hallucinate.py", line 731, in main
optimization.save_result(out_prefix, Net, ml, trb['msa'], args, trb,
File "/home/paul/RFDesign/hallucination/util/../optimization.py", line 179, in save_result
idx_tmpl = net_kwargs['idx'].cpu().numpy()[0]
KeyError: 'idx'

Any idea what the problem is?

SAP script

Hi RFDesign team,

Great work! I want to use some sequences designed by RFdesign to do protein purification. Before the experiment, I also want to use the SAP filter for these sequences, can you share your SAP compute scripts?

AF2 Model Parameters Download for af2_metrics.py

Hi RFDesign team,

I've been trying to run the af2_metrics.py program and after solving issue #26, I found that the model 4 parameters for AF2 weren't downloaded:
File "/home/ec2-user/RFDesign/scripts/../hallucination/models/alphafold/alphafold/model/data.py", line 36, in get_model_haiku_params with open(path, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: '/software/mlfold/alphafold-data/params/params_model_4.npz'

I looked into how to download them by looking at the alphafold repo that is cloned into hallucination/models/alphafold.
The readme explains that there is a script in hallucination/models/alphafold/scripts called download_alphafold_params.sh to do this.
af2_metrics.py tries to get the model parameters from /software/mlfold/alphafold-data/params/
This doesn't exist on my machine but I thought about creating this folder using mkdir and then running download_alphafold_params.sh to this directory.
Alternatively, I also tried creating a folder called hallucination/models/alphafold/alphafold-data/params/ and installing to here.
Then I changed the code in the af2_metrics.py command so that it could find the model parameters.
Running download_alphafold_params.sh also required aria2 to be installed (sudo apt install aria2 or yum install aria2 or conda install aria2) (however, I am currently stuck here on my machine because there are some inconsistencies between aria2 and the version of openssl/libssl that my machine is running :( )

Would you have any other suggestions for how to install the model 4 parameters?
Perhaps you would be able to design a way as part of the workflow of af2_metrics.py to install the af2 model 4 parameters to a place that af2_metrics can easily call from whatever machine is running the af2_metrics?

With Kind Regards,
Adam

Error while running af2_metric.py file

Hi,

I was trying to reproduce the data using the Tutorial: Hallucinating PD-L1 binder, and I have downloaded the weights using the instructions found in the alphafold repo. After running the af2_metrics.py file, I keep getting this error:

Using model_4
Traceback (most recent call last):
File "/wsu/home/hd/hd18/hd1839/myprog/RFDesign/scripts/af2_metrics.py", line 419, in
main()
File "/wsu/home/hd/hd18/hd1839/myprog/RFDesign/scripts/af2_metrics.py", line 274, in main
Lmax = max([len(s) for s in seqs])
ValueError: max() arg is an empty sequence

Any suggestions for resolving the error? Thanks.

AF2_metrics jax error

Hello Jue,

I am trying to run af2_metrics.py on my relaxed models, but I'm getting this error:

File "/projects/f_sdk94_1/PDZ_complex/RFDesign_env/SE3-nvidia/lib/python3.9/site-packages/haiku/_src/transform.py", line 264, in check_not_jax_transformed
if isinstance(f, (jax.xla.xe.CompiledFunction, jax.xla.xe.PmapFunction)): # pytype: disable=name-error
AttributeError: module 'jaxlib.xla_extension' has no attribute 'CompiledFunction'

I have built the conda environment using the yml file, but I also downgraded jax and jaxlib as specified in an earlier issue.
jax 0.2.17
jaxlib 0.1.69

Running af2_metrics using the versions of jax and jaxlib specified in the yml file yielded a similar AttributeError, where jax.ops had no attribute 'index_add'. Any help in solving this issue would be greatly appreciated.

Thanks!
Jonathan

Workflow for resultant inpainting models

I think this code should maybe have a wiki attached to it to add general knowledge?
I have been able to run and get at least something out. The PDBs do not inlclude rotamers/sidechains, but do include the identity of the residues. What is your general workflow for then incorporating these sequences and modeling the side chains? Do you have scripts available that you could share that does this?

Inpainting is trying to connect multiple chains

Trying to build in presence of a receptor as such:
contigs='A219-585,5-10,A588-735,0,R144-237'

The 5-10 loop is rebuilt, but RFDesign is trying to build between the first and second chain. It outputs everything as a single chain with some residues being moved from the first chain onto the second chain in a way that would start to connect them. Any advice on this? Thanks.

Ask about the af2 dependency under RFDesign, 'RFDesign/scripts/af2_metrics.py'

Hello dear author!

I'm very interested in your work, it's a great job!

So, I've recently been designing new sequences with RFDesign. In the process, I tried to execute RFDesign/scripts/af2_metrics.py to score the results using Alphafold2, but I ran into some problems: the process requires the AF2 dependency to be installed in the RFDesign environment, and I tried to install the AF2 dependency on top of RFDesign base to install the alphafold2 environment, but it always fails to execute af2_metrics.py successfully, the result is as follows:

image

image

I personally think it is the problem of jax and tensorflow and cuda version mismatch. What I need to ask is, what version of jax and python are you using and can you expose the files with RFDesign and alphafold2 dependencies in them? For example xx.yml or requirement.txt

This is my conda list:

Name Version Build Channel
_libgcc_mutex 0.1 main conda-forge
_openmp_mutex 4.5 1_gnu defaults
_tflow_select 2.1.0 gpu defaults
abseil-cpp 20210324.0 h9c3ff4c_0 conda-forge
absl-py 1.1.0 pyhd8ed1ab_0 conda-forge
aiohttp 3.7.4.post0 py38h497a2fe_0 conda-forge
astor 0.8.1 pyh9f0ad1d_0 conda-forge
astunparse 1.6.3 pyhd8ed1ab_0 conda-forge
async-timeout 3.0.1 py_1000 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
biopython 1.79 pypi_0 pypi
blas 1.0 mkl conda-forge
blinker 1.4 py_1 conda-forge
brotlipy 0.7.0 py38h27cfd23_1003 defaults
bzip2 1.0.8 h7b6447c_0 defaults
c-ares 1.17.1 h7f98852_1 conda-forge
ca-certificates 2022.5.18.1 ha878542_0 conda-forge
cachetools 4.2.4 pyhd8ed1ab_0 conda-forge
certifi 2022.5.18.1 py38h578d9bd_0 conda-forge
cffi 1.14.6 py38h400218f_0 defaults
chardet 4.0.0 py38h578d9bd_3 conda-forge
charset-normalizer 2.0.4 pyhd3eb1b0_0 defaults
chex 0.0.7 pypi_0 pypi
click 8.1.3 py38h578d9bd_0 conda-forge
colorama 0.4.4 pyh9f0ad1d_0 conda-forge
contextlib2 21.6.0 pypi_0 pypi
cryptography 36.0.0 py38h9ce1e76_0 defaults
cudatoolkit 11.3.1 h2bc3f7f_2 defaults
dgl-cuda11.3 0.7.2 py38_0 dglteam
dm-haiku 0.0.4 pypi_0 pypi
dm-tree 0.1.6 pypi_0 pypi
ffmpeg 4.3 hf484d3e_0 pytorch
fftw 3.3.9 h27cfd23_1 defaults
freetype 2.11.0 h70c0345_0 defaults
gast 0.3.3 py_0 conda-forge
giflib 5.2.1 h7b6447c_0 defaults
gmp 6.2.1 h2531618_2 defaults
gnutls 3.6.15 he1e5248_0 defaults
google-auth 1.35.0 pyh6c4a22f_0 conda-forge
google-auth-oauthlib 0.4.6 pyhd8ed1ab_0 conda-forge
google-pasta 0.2.0 pyh8c360ce_0 conda-forge
googledrivedownloader 0.4 pyhd3deb0d_1 conda-forge
grpc-cpp 1.37.1 h36de60a_0 conda-forge
grpcio 1.37.1 py38hdd6454d_0 conda-forge
h5py 2.10.0 nompi_py38h9915d05_106 conda-forge
hdf5 1.10.6 nompi_h7c3c948_1111 conda-forge
hhsuite 3.3.0 py38pl5262hc37a69a_2 bioconda
hmmer 3.3.2 h1b792b2_1 bioconda
icu 68.1 h58526e2_0 conda-forge
idna 3.3 pyhd3eb1b0_0 defaults
immutabledict 2.0.0 pypi_0 pypi
importlib-metadata 4.11.4 py38h578d9bd_0 conda-forge
intel-openmp 2021.4.0 h06a4308_3561 defaults
jax 0.3.13 pypi_0 pypi
jaxlib 0.3.10 pypi_0 pypi
jinja2 3.0.3 pyhd8ed1ab_0 conda-forge
joblib 1.1.0 pyhd8ed1ab_0 conda-forge
jpeg 9d h7f8727e_0 defaults
kalign2 2.04 h779adbc_2 bioconda
keras-preprocessing 1.1.2 pyhd8ed1ab_0 conda-forge
krb5 1.19.2 hcc1bbae_0 conda-forge
lame 3.100 h7b6447c_0 defaults
lcms2 2.12 h3be6417_0 defaults
ld_impl_linux-64 2.35.1 h7274673_9 defaults
libcurl 7.78.0 h2574ce0_0 conda-forge
libedit 3.1.20191231 he28a2e2_2 conda-forge
libev 4.33 h516909a_1 conda-forge
libffi 3.3 he6710b0_2 defaults
libgcc-ng 9.3.0 h5101ec6_17 defaults
libgfortran-ng 7.5.0 ha8ba4b0_17 defaults
libgfortran4 7.5.0 ha8ba4b0_17 defaults
libgomp 9.3.0 h5101ec6_17 defaults
libiconv 1.15 h63c8f33_5 defaults
libidn2 2.3.2 h7f8727e_0 defaults
libnghttp2 1.43.0 h812cca2_0 conda-forge
libpng 1.6.37 hbc83047_0 defaults
libprotobuf 3.15.8 h780b84a_0 conda-forge
libssh2 1.9.0 ha56f1ee_6 conda-forge
libstdcxx-ng 9.3.0 hd4cf53a_17 defaults
libtasn1 4.16.0 h27cfd23_0 defaults
libtiff 4.2.0 h85742a9_0 defaults
libunistring 0.9.10 h27cfd23_0 defaults
libuv 1.40.0 h7b6447c_0 defaults
libwebp 1.2.0 h89dd481_0 defaults
libwebp-base 1.2.0 h27cfd23_0 defaults
lie-learn 0.0.1.post1 pypi_0 pypi
lz4-c 1.9.3 h295c915_1 defaults
markdown 3.3.7 pyhd8ed1ab_0 conda-forge
markupsafe 2.0.1 py38h497a2fe_0 conda-forge
mkl 2021.4.0 h06a4308_640 defaults
mkl-service 2.4.0 py38h7f8727e_0 defaults
mkl_fft 1.3.1 py38hd3c417c_0 defaults
mkl_random 1.2.2 py38h51133e4_0 defaults
ml-collections 0.1.0 pypi_0 pypi
multidict 5.1.0 py38h497a2fe_1 conda-forge
ncurses 6.3 h7f8727e_2 defaults
nettle 3.7.3 hbbd107a_1 defaults
networkx 2.6.3 pyhd3eb1b0_0 defaults
numpy 1.21.2 py38h20f2e39_0 defaults
numpy-base 1.21.2 py38h79a1101_0 defaults
oauthlib 3.2.0 pyhd8ed1ab_0 conda-forge
ocl-icd 2.3.0 h7f98852_0 conda-forge
ocl-icd-system 1.0.0 1 conda-forge
olefile 0.46 pyhd3eb1b0_0 defaults
openh264 2.1.1 h4ff587b_0 defaults
openmm 7.5.1 py38ha082873_1 conda-forge
openssl 1.1.1o h7f8727e_0 defaults
opt_einsum 3.3.0 pyhd8ed1ab_1 conda-forge
packaging 21.3 pyhd3eb1b0_0 defaults
pandas 1.3.1 py38h1abd341_0 conda-forge
pdbfixer 1.7 pyhd3deb0d_0 conda-forge
perl 5.26.2 h14c3975_0 defaults
pillow 8.4.0 py38h5aabda8_0 defaults
pip 21.2.4 py38h06a4308_0 defaults
protobuf 3.15.8 py38h709712a_0 conda-forge
pyasn1 0.4.8 py_0 conda-forge
pyasn1-modules 0.2.7 py_0 conda-forge
pycparser 2.21 pyhd3eb1b0_0 defaults
pyg 2.0.3 py38_torch_1.10.0_cu113 pyg
pyjwt 2.4.0 pyhd8ed1ab_0 conda-forge
pyopenssl 21.0.0 pyhd3eb1b0_1 defaults
pyparsing 3.0.4 pyhd3eb1b0_0 defaults
pysocks 1.7.1 py38h06a4308_0 defaults
python 3.8.12 h12debd9_0 defaults
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-flatbuffers 1.12 pyhd8ed1ab_1 conda-forge
python-louvain 0.15 pyhd3deb0d_0 conda-forge
python_abi 3.8 2_cp38 conda-forge
pytorch 1.10.1 py3.8_cuda11.3_cudnn8.2.0_0 pytorch
pytorch-cluster 1.5.9 py38_torch_1.10.0_cu113 pyg
pytorch-mutex 1.0 cuda pytorch
pytorch-scatter 2.0.9 py38_torch_1.10.0_cu113 pyg
pytorch-sparse 0.6.12 py38_torch_1.10.0_cu113 pyg
pytorch-spline-conv 1.2.1 py38_torch_1.10.0_cu113 pyg
pytz 2021.3 pyhd8ed1ab_0 conda-forge
pyu2f 0.1.5 pyhd8ed1ab_0 conda-forge
pyyaml 5.4.1 py38h497a2fe_0 conda-forge
re2 2021.04.01 h9c3ff4c_0 conda-forge
readline 8.1 h27cfd23_0 defaults
requests 2.26.0 pyhd3eb1b0_0 defaults
requests-oauthlib 1.3.1 pyhd8ed1ab_0 conda-forge
rsa 4.8 pyhd8ed1ab_0 conda-forge
scikit-learn 1.0.1 py38h51133e4_0 defaults
scipy 1.7.3 py38hc147768_0 defaults
setuptools 58.0.4 py38h06a4308_0 defaults
six 1.16.0 pyhd3eb1b0_0 defaults
snappy 1.1.8 he1b5a44_3 conda-forge
sqlite 3.37.0 hc218d9a_0 defaults
svgwrite 1.4.2 pypi_0 pypi
tabulate 0.8.9 pypi_0 pypi
tensorboard 2.4.1 pyhd8ed1ab_1 conda-forge
tensorboard-plugin-wit 1.8.1 pyhd8ed1ab_0 conda-forge
tensorflow 2.4.1 py38h578d9bd_0 conda-forge
tensorflow-base 2.4.1 py38h83f5f1d_0 conda-forge
tensorflow-estimator 2.4.0 pyh9656e83_0 conda-forge
tensorflow-gpu 2.4.1 h30adc30_0 defaults
termcolor 1.1.0 py_2 conda-forge
threadpoolctl 3.0.0 pyh8a188c0_0 conda-forge
tk 8.6.11 h1ccaba5_0 defaults
toolz 0.11.2 pypi_0 pypi
torchaudio 0.10.1 py38_cu113 pytorch
torchvision 0.11.2 py38_cu113 pytorch
tqdm 4.62.3 pyhd8ed1ab_0 conda-forge
tree 0.2.4 pypi_0 pypi
typing-extensions 3.10.0.2 hd3eb1b0_0 defaults
typing_extensions 3.10.0.2 pyh06a4308_0 defaults
urllib3 1.26.7 pyhd3eb1b0_0 defaults
werkzeug 2.1.2 pyhd8ed1ab_1 conda-forge
wheel 0.37.0 pyhd3eb1b0_1 defaults
wrapt 1.12.1 py38h497a2fe_3 conda-forge
xz 5.2.5 h7b6447c_0 defaults
yacs 0.1.6 py_0 conda-forge
yaml 0.2.5 h516909a_0 conda-forge
yarl 1.6.3 py38h497a2fe_2 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h7f8727e_4 defaults
zstd 1.4.9 haebb681_0 defaults

I would really like to get your answer, thank you very much!

predict with alphafold meet jax problem

When I want to run the script af2_metrics.py, I get the following ModuleNotFoundError:
if jax.config.jax_experimental_name_stack and module_name:
AttributeError: 'Config' object has no attribute 'jax_experimental_name_stack'

Garbled output for inpainting

Hello!

I am trying the inpainting test PDB. When I try the default mask or another loop, I get a garbled PDB output. I realize it's backbone-only, but it has not structure, just looks like spaghetti. Any recommendations?

python ../inpaint.py --task hal --checkpoint v02 --pdb=input/2KL8.pdb --out=output/inpaint_test --window=A,20,25 --num_designs 1 --inf_method=multi_shot --n_iters 10 --recycle_str_mode both  --clamp_1d 0.1 --dump_all

Error while running af2_interface_metrics.py

Hi,

According your suggestions, I tried to run af2_interface_metrics.py to validate the plausibility of my hallucinated binder after creating silent file.

However there is an error as below.

Is it an error originated from the af2_interface_metrics.py ?

or from my conda environment setting ?

I attached my conda export file too.

command
CUDA_VISIBLE_DEVICES=1 python3 /opt/tools/RFDesign/scripts/af2_interface_metrics.py -silent in.silent

terminal message
/opt/tools/RFDesign/scripts/af2_interface_metrics.py:46: UserWarning: Import of 'rosetta' as a top-level module is deprecated and may be removed in 2018, import via 'pyrosetta.rosetta'.
from rosetta import *
PyRosetta-4 2022 [Rosetta PyRosetta4.Release.python39.ubuntu 2022.23+release.f1e0f6d7bf74728d46e42a39ffab1eedf8c1c936 2022-06-09T16:58:25] retrieved from: http://www.pyrosetta.org
(C) Copyright Rosetta Commons Member Institutions. Created in JHU by Sergey Lyskov and PyRosetta Team.
core.init: Checking for fconfig files in pwd and ./rosetta/flags
core.init: Rosetta version: PyRosetta4.Release.python39.ubuntu r321 2022.23+release.f1e0f6d7bf7 f1e0f6d7bf74728d46e42a39ffab1eedf8c1c936 http://www.pyrosetta.org 2022-06-09T16:58:25
core.init: command: PyRosetta -in:file:silent_struct_type binary -database /opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/pyrosetta-2022.23+release.f1e0f6d7bf7-py3.9-linux-x86_64.egg/pyrosetta/database
basic.random.init_random_generator: 'RNG device' seed mode, using '/dev/urandom', seed=-1724994589 seed_offset=0 real_seed=-1724994589
basic.random.init_random_generator: RandomGenerator:init: Normal mode, seed=-1724994589 RG_type=mt19937
core.io.silent.SilentFileData: Reading all structures from in.silent
core.io.silent.SilentFileData: Finished reading 18 structures from in.silent
core.chemical.GlobalResidueTypeSet: Finished initializing fa_standard residue type set. Created 985 residue types
core.chemical.GlobalResidueTypeSet: Total time to initialize 0.57772 seconds.
The distance between residues 55 and 56 is 19.21 A > limit 3 A.
I'm going to insert a chainbreak after residue 55
running model_1_ptm
['run_1_gpu_0_10']
Traceback (most recent call last):
File "/opt/tools/RFDesign/scripts/af2_interface_metrics.py", line 598, in
predict_structure(tag_buffer, feature_dict_dict, binderlen_dict, initial_guess_dict, sfd_out, scorefilename)
File "/opt/tools/RFDesign/scripts/af2_interface_metrics.py", line 432, in predict_structure
prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params,
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/_src/traceback_util.py", line 183, in reraise_with_filtered_traceback
return fun(*args, **kwargs)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/_src/api.py", line 1294, in batched_fun
out_flat = batching.batch(
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/linear_util.py", line 166, in call_wrapped
ans = self.f(*args, **dict(self.params, **kwargs))
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/_src/traceback_util.py", line 183, in reraise_with_filtered_traceback
return fun(*args, **kwargs)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/_src/api.py", line 424, in cache_miss
out_flat = xla.xla_call(
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1560, in bind
return call_bind(self, fun, *args, **params)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1551, in call_bind
outs = primitive.process(top_trace, fun, tracers, params)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1563, in process
return trace.process_call(self, fun, tracers, params)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/batching.py", line 159, in process_call
vals_out = call_primitive.bind(f, *vals, **params)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1560, in bind
return call_bind(self, fun, *args, **params)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1551, in call_bind
outs = primitive.process(top_trace, fun, tracers, params)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 1563, in process
return trace.process_call(self, fun, tracers, params)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/core.py", line 606, in process_call
return primitive.impl(f, *tracers, **params)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/xla.py", line 592, in _xla_call_impl
compiled_fun = _xla_callable(fun, device, backend, name, donated_invars,
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/linear_util.py", line 262, in memoized_fun
ans = call(fun, *args)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/xla.py", line 667, in _xla_callable
jaxpr, out_avals, consts = pe.trace_to_jaxpr_final(
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/partial_eval.py", line 1284, in trace_to_jaxpr_final
jaxpr, out_avals, consts = trace_to_subjaxpr_dynamic(fun, main, in_avals)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/interpreters/partial_eval.py", line 1262, in trace_to_subjaxpr_dynamic
ans = fun.call_wrapped(*in_tracers)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/jax/linear_util.py", line 166, in call_wrapped
ans = self.f(*args, **dict(self.params, **kwargs))
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/haiku/_src/transform.py", line 125, in apply_fn
out, state = f.apply(params, {}, *args, **kwargs)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/haiku/_src/transform.py", line 313, in apply_fn
out = f(*args, **kwargs)
jax._src.traceback_util.UnfilteredStackTrace: TypeError: _forward_fn() takes 1 positional argument but 2 were given

The stack trace below excludes JAX-internal frames.
The preceding is the original exception that occurred, unmodified.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/tools/RFDesign/scripts/af2_interface_metrics.py", line 598, in
predict_structure(tag_buffer, feature_dict_dict, binderlen_dict, initial_guess_dict, sfd_out, scorefilename)
File "/opt/tools/RFDesign/scripts/af2_interface_metrics.py", line 432, in predict_structure
prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params,
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/haiku/_src/transform.py", line 125, in apply_fn
out, state = f.apply(params, {}, *args, **kwargs)
File "/opt/miniconda3/envs/afscore_forbinder/lib/python3.9/site-packages/haiku/_src/transform.py", line 313, in apply_fn
out = f(*args, **kwargs)
TypeError: _forward_fn() takes 1 positional argument but 2 were given

conda export
afscore_forbinder_requirements.txt

How to mask out the amino acid in that mutation position?

Hello, I have recently read your latest paper "Accurate Mutation Effect Prediction using RoseTTAFold", a great work, and I want to try it, but I do not know how to mask out the amino acid in that mutation position in MSA or what to replace the mutant amino acid with. Could you please provide a complete use case and example data, thank you.

Unclear documentation/tutorial or mistake

In Tutorial: Hallucinating PD-L1 binder, Pt 1, Generating Commands, force_aa is declared but never used. force_aa is declared again and used only in "Run 2: 2-chain hallucination".

This is confusing, because it's unclear whether to use force_aa or mask in order to specify which residues to keep the same. One or the other ought to make the other redundant.

About arguments in hallucination.py for two-chain hallucination

I have several questions about free hallucination to generate protein binders.

Here is my command line input.

python3 /opt/tools/RFDesign/hallucination/hallucinate.py 
--pdb=./binder.pdb 
--out=test/test 
--steps=m300 
--num=10 
--start_num=1 
--mask=13,A9-15,60 
--spike=0.05 
--spike_fas=./binder_80aa.fasta 
--exclude_aa=C 
--receptor=./receptor_trunc.pdb 
--rec_placement=second 
--w_rog=1 
--rog_thresh=16 
--save_pdb=True 
--track_step 1 
--use_template=A9-15

Q1
I want to know whether the --mask=10,A6-10,65 (total 80 aa) and --mask=80 are same when the argument --spike is set to 0.05.

In addition,
Since the --spike=0.05 means random sequence, I think that there is no significancy which sequence is enter to the --spike_fas, but there is significancy only in the sequence length. is it right ?

Q2
In the Fig S17-C of the 2022 Science paper,

it seems that only the binding target (= receptor?) was used as template.

If it is right, how can I enter the binding target as template ? which argument is required ?

or is binding target automatically provided as template to hallucination if the binding target pdb file is provided to the --receptor argument ?

Q3
To perform free hallucination, I run the script without --use_template, but some error was occurred.

Saving /proc_1/RFDesign/binder/test/test_1: Traceback (most recent call last):
  File "/opt/tools/RFDesign/hallucination/hallucinate.py", line 739, in <module>
    main()
  File "/opt/tools/RFDesign/hallucination/hallucinate.py", line 731, in main
    optimization.save_result(out_prefix, Net, ml, trb['msa'], args, trb, 
  File "/opt/tools/RFDesign/hallucination/util/../optimization.py", line 179, in save_result
    idx_tmpl = net_kwargs['idx'].cpu().numpy()[0]
KeyError: 'idx'

When I enter the dummy value (like Z999-1000) to the --use_template, then the script worked well.

is it proper way to perform free hallucination ?

Sincerely,

jongseo

Unnecessary residue change when loop inpainting.

Hi!

I tried to rebuild a loop of my protein of interest using the following:

python /repo/RFDesign/inpainting/inpaint.py --pdb ../my.pdb --contigs A1-338,2-3,A343-585 --out RF_inpaint/338-343_pilot --num_designs 10

python /repo/RFDesign/inpainting/inpaint.py --pdb ../my.pdb --contigs A1-336,3-5,A344-585 --out RF_inpaint/336-344_pilot --num_designs 10

and the multiple sequence alignment shows one extra residue mutation in the fixed region of 5 decoys. Is that a bug? Does this extra mutation make sense?

I saw these mutations far away from my target loop in structure.

checkpoint file not found problem about inpaint

Hi, developers

i am trying to run test in inpaint and i got the following problem:
Where can i find the folder and file "envsjwatson3_first_full_epoch/BFF_epoch_0_fraction_1.0.pt"
Thanks a lot.

Loading checkpoint v02: /home/yanx/Dev/repos/RFDesign/envsjwatson3_first_full_epoch/BFF_epoch_0_fraction_1.0.pt...
Traceback (most recent call last):
File "../inpaint.py", line 837, in
main()
File "../inpaint.py", line 375, in main
ckpt = torch.load(cp_path, map_location=DEVICE)
File "/home/yanx/.conda/envs/se3test/lib/python3.8/site-packages/torch/serialization.py", line 594, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/yanx/.conda/envs/se3test/lib/python3.8/site-packages/torch/serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/yanx/.conda/envs/se3test/lib/python3.8/site-packages/torch/serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/home/yanx/Dev/repos/RFDesign/envsjwatson3_first_full_epoch/BFF_epoch_0_fraction_1.0.pt'

Missing minterface.xml in scripts folder

Hi,

Per the last issue #19 it seemed that minterface.xml and relax.flags had been provided, though only relax.flags is present in scripts/.

Any way to also get minterface.xml uploaded to scripts? :)

AF2 metrics prediction jax error

As also reported in #13, running the af2_interface_metrics.py step in the SH3 tutorial results in the following Jax error:

TypeError: _forward_fn() takes 1 positional argument but 2 were given

Specifically, this is the code that causes it.

 prediction_result = jax.vmap(model_runner.apply, in_axes=(None,None,0,0))(model_runner.params,
          jax.random.PRNGKey(0), processed_feature_dict, processed_initial_guess_dict)

#13 got closed by the issue author as removing the initial_guess logic allowed the code to run.

I opened this issue as it is my understanding that this initial guess logic is a big part of the method which was outlined in https://doi.org/10.1101/2022.06.15.495993 (N. Bennet et al 2022).

Do you know of a way to fix this error or is it still valuable to run it without the initial_guess?
Seems to be the last step i need before being able to run through the tutorial in its entirety :)

Missing compile_metrics.py in scripts folder

When I was going through tutorial, it seemedd that /scripts/compile_metrics.py was missing. Besides, there was no clues for me to figure out how to calculate new metric called rosetta_energy

about inpainting details

Hi, developers

i am trying to play the inpainting method, i use the test case 2KL8.pdb,and i keep the contigs from A2-8 and to rebuild the left structure.

what i use the command:

!python inpaint.py --task hal --checkpoint v02
--pdb=./test/input/2KL8.pdb
--out=./test/output/inpaint_test2
--contigs A2-8 --len 100
--num_designs 1
--inf_method=multi_shot --n_iters 10 --recycle_str_mode both --clamp_1d 0.1 --dump_all

result:
Generating design 0 (1 total)...
mask_str (1=rebuild; 0=keep):
1111111111111111111111111111111111111111111100000001111111111111111111111111111111111111111111111111
mask_seq (1=rebuild; 0=keep):
1111111111111111111111111111111111111111111100000001111111111111111111111111111111111111111111111111
0 LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEMDIRFRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
1 KLLLLLLLLKELLLKLLLKLLLKLLKKLKLLLLELLELLLKLLEEMDIRFRLLLLLLLELLLELLEELLELLLLLLKKLLLLLLLLLLLLLLLLLLLLLL
2 SLKLEESLLLLELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEMDIRFRLNLELLEELLELLLELLLLLLELLKLLLLLLLLLLLLLLLLLLLLLLLL
3 KLKLEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEMDIRFRLLLELLEELLELLLELLLLLLELLLELLLLLLLLLLLLLLLLLLLLLLL
4 SLLLKLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLEMDIRFRLLLELLLELLELLLELLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLL
5 KLKLPESLLLLLLLLLLLLLLLLLLLKLKLSLLLLKLLLELLLKEMDIRFRLSGELLEELLELLLELLELLLELLLLLLLLLLLLLLLLLLLLLLLLLLL
6 SLKLLELLLLLLLLLLLLLLLLLLLLGLKLSLLLLLKLLELLLEEMDIRFRLLLGLLLLLLELLLELLELLLELLLLLLLLLLLLLLLLLLLLLLLLLLL
7 SLKLLELLLLLELLLLLLLLLLLLLLGLKLSLLNLKKLLKLLLEEMDIRFRLLLGLNLELLELLLLLLLLLLELLLLLLLLLLLLLLLLLLLLLLLLLLL
8 SLKLLELSLLLELLLLLLLLLLLLLLLLKLSLLNLLELLELLLKEMDIRFRLLLGLNLELLELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
9 SLKLLELSLLLELLLLLLLLLLLLLLKLKLSLLLLLELLKLLLKEMDIRFRLLLGPLLELLELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
Designed sequence (excluding receptor):
SLKLLELSLLLELLLLLLLLLLLLLLKLKLSLLLLLELLKLLLKEMDIRFRLLLGPLLELLELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
Saving outputs for /content/RFDesign/inpainting/test/output/inpaint_test2_0: pdb npz fas trb
Finished design in 7.80 seconds.
Max CUDA memory: 2.1457G

after 10 iters, the sequence seem abnormal, can you giving me some suggestions to make it better?

thanks,
weikun

RFDesign inpainting ./run_tests.sh: line 12: 7385 segmentation fault (core dumped)

When i run RFDesign/inpainting/tests/run_tests.sh, the problem occurred:
(base) [root@localhost tests]# conda activate SE3-nvidia
(SE3-nvidia) [root@localhost tests]# ./run_tests.sh
Using backend: pytorch
./run_tests.sh: line 12: 7385 segmentation fault (core dumped)
python $script --pdb $pdb --contigs $contigs --dump_all --n_cycle 15 --out $out --num_designs $num_designs
(SE3-nvidia) [root@localhost tests]#

anyone know how to solve this problem? Thank you !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.