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

Search script and OMG database #9

Open
rakeshr10 opened this issue Jan 9, 2025 · 1 comment
Open

Search script and OMG database #9

rakeshr10 opened this issue Jan 9, 2025 · 1 comment

Comments

@rakeshr10
Copy link

Hi,

Is there a python script for search and retrieval tasks which could be used without the server? How to do residue level and sequence level retrieval as shown in the paper.

Also I don't see the OMG database related weights or faiss index file. Would be glad if you could comment on this.

Regards
Rakesh

@LTEnjoy
Copy link
Contributor

LTEnjoy commented Jan 10, 2025

Hi Rakesh,

Is there a python script for search and retrieval tasks which could be used without the server? How to do residue level and sequence level retrieval as shown in the paper.

We don't directly provide a python script for retrieval tasks. However you could easily implement it by yourself! You could follow below steps:

  1. Load the ProTrek model and calculate your query embedding. See here.
  2. Directly load faiss index. If you have already downloaded the faiss index files from here, you could dive into the folder and see .index files and corresponding ids.tsv files. An example for your retrieval would be:
import faiss

# Load model and get query embedding
...

# Load faiss index
path  = "/your/path/to/***.index"
index = faiss.read_index(path)
index.metric_type = faiss.METRIC_INNER_PRODUCT

# Start retrieval
topk = 10
scores, ranks = index.search(query_embedding, topk)

# Once you get ranks, you could load "ids.tsv" to get the information of retrieved candidates
...

For more details about the usage of the faiss library, please refer to the official github repo here. If you want to perform residue-level or sequence-level retrieval, you only need to load corresponding .index file and follow the above steps.

I don't see the OMG database related weights or faiss index file. Would be glad if you could comment on this.

Yes. Currently we don't upload other database index files due to their large size (~hundreds of GB). You could use our online server to access these databases. We are working hard on making it more handy and efficient :)

Best regards,
Jin

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