Coder Social home page Coder Social logo

dsmbind's People

Contributors

wengong-jin 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

Watchers

 avatar

dsmbind's Issues

Missing 'FARigidModel' in the code.

Hi,

I am intrigued by your recent article on DSMBind. I tried to run the tutorial.ipynb and found DSMBind/bindenergy/models/rigid.py is missing 'FARigidModel'. Could you add this, please?

issue of the code process_antibody.py

I found this code in the path of data/antibody, looks likely it is used for generating the jsonl such as "test_sabdab.jsonl", however, from the code, it only can generate information on antibody, not including antigen, could you please provide a complete version? thanks

License: is it free open-source?

Hi Wengong,
This tool is super exciting! Would it be possible to add a license file? We are not sure if we are allowed to try it.

missing code of "chemprop" class

I got an error as below:

File "tutorial.py", line 7, in
from bindenergy.models import DrugAllAtomEnergyModel
File "/DSMBind/bindenergy/models/init.py", line 3, in
from .drug import *
File "/DSMBind/bindenergy/models/drug.py", line 9, in
from chemprop.features import BatchMolGraph, get_atom_fdim, get_bond_fdim, mol2graph
ModuleNotFoundError: No module named 'chemprop'

cannot find any class definition of "chemprop", could you please help on it? thanks

Source of Mutant Structures for Skempi + PDB preprocessing?

Hi!
I am trying to use the build_skempi.py script to process some similar data for testing, and I have a few questions.

  1. It looks like the build_skempi.py script expects there to be mutant structures to run on, but skempi does not not provide mutant structures. How were these mutant structures obtained? Can you point me to where I can find them or how I should generate them (PyRosetta, FoldX etc.), starting from wild type PDB's?
  2. When trying to run the build script on new PDB's, I run into a reshaping error on this line of code
 def process(tup):
    pdb, achain, bchain = tup
    _, acoords, aseq, _, _ = get_seq_coords_and_angles(achain)
    _, bcoords, bseq, _, _ = get_seq_coords_and_angles(bchain)
    acoords = acoords.reshape((-1,14,3))
    bcoords = bcoords.reshape((-1,14,3))
    return (pdb, aseq, acoords, bseq, bcoords)

(cannot reshape array of size 12330 into shape (14,3)). If I instead change this line to (-1,15,3), the processing script runs, but the model expects coordinates in groups of 14. Do I need to preprocess my PDB's first?
Thanks!

Account over LFS quota

I'm unable to clone the data due to an LFS error:

$ git clone https://github.com/wengong-jin/DSMBind.git
Cloning into 'DSMBind'...
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 61 (delta 0), reused 0 (delta 0), pack-reused 58
Unpacking objects: 100% (61/61), 51.86 MiB | 15.09 MiB/s, done.
Downloading data/antibody/test_HER2.jsonl (94 MB)
Error downloading object: data/antibody/test_HER2.jsonl (3cc268d): Smudge error: Error downloading data/antibody/test_HER2.jsonl (3cc268d539af711b87962c5807f4558ac00f6d4e7319b98b50652189c152e88e): batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.

Is the test data hosted anywhere else? Perhaps https://zenodo.org/ could be a good option (and would include a DOI).

How to reproduce this work?

DSMBind is really a great work.
We want to reproduce this work. However, we can not find the actual dataset used in this work. We will appreciate it if you can provide the dataset used in this work or give a detailed description.
Thanks
Sincerely.

RuntimeError: Caught an unknown exception!

Hi,

I've been trying to run the tutorial, however, I'm facing the following error. As input, I'm using the test file provided along with this repo. I tried to use different inputs but it raises the same error. I also tried to use a different version of Pytorch, but it didn't help.

Would you know how to solve this issue?

thanks.

Full error details

RuntimeError Traceback (most recent call last)
Cell In[12], line 1
----> 1 sabdab_evaluate(model, test_data, embedding, model_args)

Cell In[11], line 6, in sabdab_evaluate(model, data, embedding, args)
4 for ab in tqdm(data):
5 binder, target = AntibodyDataset.make_local_batch([ab], embedding, args)
----> 6 score = model.predict(binder, target)
7 pred.append(-1.0 * score.item())
8 label.append(ab['affinity'])

File ./bindenergy/models/energy.py:269, in AllAtomEnergyModel.predict(self, binder, target, visual)
266 D = (bind_X.view(B,N14,1,3) - tgt_X.view(B,1,M14,3)).norm(dim=-1) # [B,N14,M14]
267 mask_2D = mask_2D * (D < self.threshold).float()
--> 269 h = self.encoder(
270 (bind_X, bind_S, bind_A, None),
271 (tgt_X, tgt_S, tgt_A, None),
272 ) # [B,N+M,14,H]
274 bind_h = self.W_o(h[:, :N]).view(B, N14, -1)
275 tgt_h = self.U_o(h[:, N:]).view(B, M
14, -1)

File ~/conda/lib/python3.8/site-packages/torch/nn/modules/module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs)
1516 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1517 else:
-> 1518 return self._call_impl(*args, **kwargs)

File ~/conda/lib/python3.8/site-packages/torch/nn/modules/module.py:1527, in Module._call_impl(self, *args, **kwargs)
1522 # If we don't have any hooks, we want to skip the rest of the logic in
1523 # this function, and just call forward.
1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1525 or _global_backward_pre_hooks or _global_backward_hooks
1526 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1527 return forward_call(*args, **kwargs)
1529 try:
1530 result = None

File ./bindenergy/models/frame.py:132, in AllAtomEncoder.forward(self, binder, target)
129 mask = mask.unsqueeze(1).expand(-1,8,-1).reshape(B*8, (N+M)*14)
131 h = torch.cat([h_X, h_S], dim=-1)
--> 132 h, _, _ = self.encoder(
133 h.transpose(0, 1),
134 mask_pad=(~mask.transpose(0, 1).bool())
135 )
136 h = h.transpose(0, 1).view(B, 8, (N+M)*14, -1)
137 h = h.mean(dim=1) # frame averaging

File ~/conda/lib/python3.8/site-packages/torch/nn/modules/module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs)
1516 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1517 else:
-> 1518 return self._call_impl(*args, **kwargs)

File ~/conda/lib/python3.8/site-packages/torch/nn/modules/module.py:1527, in Module._call_impl(self, *args, **kwargs)
1522 # If we don't have any hooks, we want to skip the rest of the logic in
1523 # this function, and just call forward.
1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1525 or _global_backward_pre_hooks or _global_backward_hooks
1526 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1527 return forward_call(*args, **kwargs)
1529 try:
1530 result = None

File ~/conda/lib/python3.8/site-packages/sru/modules.py:1215, in SRUpp.forward(self, input, c0, mask_pad, attn_mask, memory, memory_mask_pad)
1213 prev_inputs.append(x)
1214 memory_i = memory[i] if memory is not None else None
-> 1215 h, c = rnn(x, c0_[i],
1216 mask_pad=mask_pad,
1217 attn_mask=attn_mask,
1218 memory=memory_i,
1219 memory_mask_pad=memory_mask_pad)
1220 x = h
1221 lstc.append(c)

File ~/conda/lib/python3.8/site-packages/torch/nn/modules/module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs)
1516 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]
1517 else:
-> 1518 return self._call_impl(*args, **kwargs)

File ~/conda/lib/python3.8/site-packages/torch/nn/modules/module.py:1527, in Module._call_impl(self, *args, **kwargs)
1522 # If we don't have any hooks, we want to skip the rest of the logic in
1523 # this function, and just call forward.
1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
1525 or _global_backward_pre_hooks or _global_backward_hooks
1526 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1527 return forward_call(*args, **kwargs)
1529 try:
1530 result = None

File ~/conda/lib/python3.8/site-packages/sru/modules.py:930, in SRUppCell.forward(self, input, c0, mask_pad, attn_mask, memory, memory_mask_pad)
927 V = self.weight_c
929 # apply elementwise recurrence to get hidden states h and c
--> 930 h, c = self.apply_recurrence(U, V,
931 residual, c0,
932 scale_val,
933 mask_c,
934 mask_pad)
936 layer_norm = self.layer_norm
937 if layer_norm is not None:

File ~/conda/lib/python3.8/site-packages/sru/modules.py:268, in SRUCell.apply_recurrence(self, U, V, residual, c0, scale_val, mask_c, mask_pad)
266 if not torch.jit.is_scripting():
267 if self.bias.is_cuda:
--> 268 return elementwise_recurrence_gpu(U, residual, V, self.bias, c0,
269 self.activation_type,
270 self.hidden_size,
271 self.bidirectional,
272 self.has_skip_term,
273 scale_val, mask_c, mask_pad,
274 self.amp_recurrence_fp16)
275 else:
276 return elementwise_recurrence_naive(U, residual, V, self.bias, c0,
277 self.activation_type,
278 self.hidden_size,
279 self.bidirectional,
280 self.has_skip_term,
281 scale_val, mask_c, mask_pad)

File ~/conda/lib/python3.8/site-packages/sru/ops.py:130, in elementwise_recurrence_gpu(U, x, weight_c, bias, c_init, activation_type, hidden_size, bidirectional, has_skip_term, scale_x, dropout_mask_c, mask_pad, amp_recurrence_fp16)
127 scale_x = cast(scale_x) if scale_x is not None else scale_x
128 dropout_mask_c = cast(dropout_mask_c) if dropout_mask_c is not None else dropout_mask_c
--> 130 return ElementwiseRecurrence.apply(
131 U,
132 x,
133 weight_c,
134 bias,
135 c_init,
136 activation_type,
137 hidden_size,
138 bidirectional,
139 has_skip_term,
140 scale_x,
141 dropout_mask_c,
142 mask_pad
143 )

File ~/conda/lib/python3.8/site-packages/torch/autograd/function.py:539, in Function.apply(cls, *args, **kwargs)
536 if not torch._C._are_functorch_transforms_active():
537 # See NOTE: [functorch vjp and autograd interaction]
538 args = _functorch.utils.unwrap_dead_wrappers(args)
--> 539 return super().apply(*args, **kwargs) # type: ignore[misc]
541 if cls.setup_context == _SingleLevelFunction.setup_context:
542 raise RuntimeError(
543 "In order to use an autograd.Function with functorch transforms "
544 "(vmap, grad, jvp, jacrev, ...), it must override the setup_context "
545 "staticmethod. For more details, please see "
546 "https://pytorch.org/docs/master/notes/extending.func.html"
547 )

File ~/conda/lib/python3.8/site-packages/sru/cuda_functional.py:176, in ElementwiseRecurrence.forward(ctx, u, x, weight_c, bias, init, activation_type, d_out, bidirectional, has_skip_term, scale_x, mask_c, mask_pad)
174 # ensure mask_pad is a bool tensor
175 mask_pad = mask_pad.bool().contiguous() if mask_pad is not None else None
--> 176 h, last_hidden, c = elementwise_recurrence_forward(
177 u,
178 x,
179 weight_c,
180 bias,
181 init,
182 activation_type,
183 d_out,
184 bidirectional,
185 has_skip_term,
186 scale_x,
187 mask_c,
188 mask_pad
189 )
190 ctx.save_for_backward(u, x, weight_c, bias, init, mask_c, c, mask_pad, scale_x)
191 return h, last_hidden

RuntimeError: Caught an unknown exception!

Issue with SRU++/CUDA compatibility

Hello again!

Thank you for the help with my previous issue. I am trying to run your model on a GPU to train on some new data, however, there is an issue with the SRU and CUDA that I haven't been able to resolve (Runtime: Caught an unknown exception! Failed to compile CUDA kernels). I've tried a few different version combinations, and have not found one that works. Can you specify which exact versions of PyTorch and CUDA you used or point me to a fix?

Thanks!
Kevin B.

Request for Missing Code Related to Contrastive Learning

Dear Author,

Hello! I recently read your article and am very intrigued by your research.

I attempted to access the relevant code, but unfortunately, I couldn't find the Code Related to Contrastive Learning mentioned in the article.

Would it be possible for you to provide the missing portion of the code? If this code is already included in another file, I would appreciate it if you could point that out.

Best regards

about the issue of missing the training data

Hi, thanks for your amazing work. I believe this work will change this field a lot.

However, when I try to train you model, I found that some training data is missing. For example,
data/protein/data.pkl
data/skempi/data.pkl
those file are mentioned in the bindenergy/apps/protein/energy_train.py . However, I didn't found those file in the zenodo link. am I missed something?

I will be appreciate if the author can provide the training data. 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.