Closed avivko closed 1 year ago
Hey @avivko
Could you try with:
graphein_config = gp.ProteinGraphConfig(
graph_metadata_functions=[
gp.esm_residue_embedding
partial(gp.esm_residue_embedding, model_name=model)
])
I tried it in your colab and it seems to work (thanks for including that!).
It’s unintuitive (and ugly API-wise) but the per-residue node embeddings need access to the whole sequence in order to compute them, so this function doesn’t quack like typical node metadata functions which depend exclusively on information contained within nodes.
The underlying function should still distribute the embeddings to the nodes
How did you get on @avivko? Can I close the issue?
I've tried to catch the error with a more informative message in 1.6.0 (Now resolved in 1.6.0 (pip install graphein=1.6.0
)
Sorry for the delay in my response. Your suggestion worked, thanks!
Describe the bug 1)
gp.esm_residue_embedding
yields a the an error (see error stack 1 bellow) during graph construction 2) Using the following partial on this functionpartial(gp.esm_residue_embedding, model_name="esm2_t33_650M_UR50D")
also yields an error (see error stack 2).To Reproduce Run this Colab: https://colab.research.google.com/drive/1M2N9ZFS7WGdnyNBSo--n8l9hBwEbO0qn?usp=sharing
Expected behavior gp.esm_residue_embedding should work and should also work with a partial specifying the model.
Screenshots Error stack 1:
Error stack 2:
Desktop (please complete the following information):