generatebio / chroma

A generative model for programmable protein design
Apache License 2.0
627 stars 74 forks source link

the structure of sequences generated by chroma.design() #32

Closed Lyn-666 closed 5 months ago

Lyn-666 commented 6 months ago

hi, thanks for this amazing work. I am trying to use chroma.design() to redesign my protein (chain4_cdlm.pdb). I wonder how can I get the structure of redesigned sequences (protein1) using chroma? I directly display the redesigned protein(protein1), but I found it is the structure is exactly the same as my input protein (chain4_cdlm.pdb) . Hope you could give me some suggestion! Thanks a lot!

# Configure Substructure Conditioner
from chroma.utility.chroma import plane_split_protein

device='cuda'

chroma = Chroma()

protein = Protein('/home/lynn/Desktop/6mrd/6mrd_pdb/chain4_cdlm.pdb',  device=device)

print(protein)

protein1 = chroma.design(protein, design_selection='resid 50-100')
print(protein1)
display(protein1)
wujiewang commented 6 months ago

Thanks for submitting an issue.

I couldn't reproduce your case. I tried a different protein and the design method works as expected. Can you try the following code to see if it works for you?

from chroma.data import Protein
from chroma.models.structure.chroma import Chroma

chroma = Chroma()
protein = Protein('1qys',  device='cuda')

protein1 = chroma.design(protein, design_selection='resid 50-100')
display(protein1)
Lyn-666 commented 6 months ago

Hi, I try to rerun your code, but it shows ModuleNotFoundError: No module named 'chroma.models.structure, and I changed from chroma.models.structure.chroma import Chroma to from chroma.models.chroma import Chroma. It works, but it still doesn't work as expected.

This is my code

from chroma.data import Protein
from chroma.models.chroma import Chroma

chroma = Chroma()
protein = Protein('1qys',  device='cuda')

print(protein.sequence())

display(protein)

protein1 = chroma.design(protein, design_selection='resid 1-50')

print(protein1.sequence())

display(protein1)

The output shows the sequence of redesigned protein is correct, but the the structure of redesigned protein is totally the same as the template protein. I don't think it make sense, but maybe my code or understanding of chroma.design() is wrong. Thanks very much! Screenshot from 2024-01-02 12-15-48

wujiewang commented 6 months ago

Thanks for providing more info. Based on your screenshot, the sidechains are different as expected.

When you say "redesigned protein is totally the same as the template protein", do you mean something else?

Lyn-666 commented 5 months ago

Thanks very much. Yes, I checked the PDB files, the coordinates of some atoms are different, so they are not exactly the same. Thanks for your amazing work!

wujiewang commented 5 months ago

Nice, thanks for the feedback! I am closing this issue for now, let us know if you have more questions.