Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting PAE matrix #5

Closed
gezmi opened this issue May 17, 2023 · 1 comment
Closed

Getting PAE matrix #5

gezmi opened this issue May 17, 2023 · 1 comment

Comments

@gezmi
Copy link

gezmi commented May 17, 2023

Hi,

Nice work! Would it be possible to also return the PAE matrix for each decoy?

Thank you!

@jproney
Copy link
Owner

jproney commented Jun 10, 2023

Sure! I think the easiest way to do this is with a slight modification of the Colab notebook that is linked in the README. There's a function in that notebook called _get_score under the "Import Libraries" header. If you replace that with this very slightly modified version:

  def _get_score(self):
    score = copy_dict(self.model.aux["log"])

    score["plddt"] = score["plddt"]
    score["pae"] = 31.0 * score["pae"]
    score["rmsd_io"] = score.pop("rmsd",None)

    i_xyz = self.model._inputs["batch"]["all_atom_positions"][:,1]
    o_xyz = np.array(self.model.aux["atom_positions"][:,1])

    # TMscore to input/output
    if hasattr(self,"wt_batch"):
      n_xyz = self.wt_batch["all_atom_positions"][:,1]
      score["tm_i"] = tmscore(n_xyz,i_xyz)["tms"]
      score["tm_o"] = tmscore(n_xyz,o_xyz)["tms"]

    # TMscore between input and output
    score["tm_io"] = tmscore(i_xyz,o_xyz)["tms"]

    # composite score
    score["composite"] = score["ptm"] * score["plddt"] * score["tm_io"]
    score["pae_full"] = np.copy(self.model.aux["pae"])
    return score

then the full PAE matrix will be part of the output. The only modification here is in the second-to-last line. Then, after running the rest of the notebook, the SCORES variable will have pae_full as one of its features, which you can use however you want. Let me know if that helps!

@jproney jproney closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants