williamgilpin / pypdb

A Python API for the RCSB Protein Data Bank (PDB)
MIT License
309 stars 77 forks source link

Searching via EC number #56

Open erfantoloue opened 1 year ago

erfantoloue commented 1 year ago

Hello. I want to know whether I can use PyPDB to search for PDB files via their Enzyme Classification number. Currently, I am able to search it with the normal query search but the results are more accurate if EC Number was searched specifically.

For instance, the url for the query search of EC number 2.3.2.5 in the PDB database is: https://www.rcsb.org/search?request=%7B%22query%22%3A%7B%22type%22%3A%22group%22%2C%22nodes%22%3A%5B%7B%22type%22%3A%22group%22%2C%22nodes%22%3A%5B%7B%22type%22%3A%22terminal%22%2C%22service%22%3A%22text%22%2C%22parameters%22%3A%7B%22attribute%22%3A%22rcsb_polymer_entity.rcsb_ec_lineage.id%22%2C%22negation%22%3Afalse%2C%22operator%22%3A%22in%22%2C%22value%22%3A%5B%222.3.2.5%22%5D%7D%7D%5D%2C%22logical_operator%22%3A%22and%22%2C%22label%22%3A%22text%22%7D%5D%2C%22logical_operator%22%3A%22and%22%7D%2C%22return_type%22%3A%22entry%22%2C%22request_options%22%3A%7B%22paginate%22%3A%7B%22start%22%3A0%2C%22rows%22%3A25%7D%2C%22results_content_type%22%3A%5B%22experimental%22%5D%2C%22sort%22%3A%5B%7B%22sort_by%22%3A%22score%22%2C%22direction%22%3A%22desc%22%7D%5D%2C%22scoring_strategy%22%3A%22combined%22%7D%2C%22request_info%22%3A%7B%22query_id%22%3A%22e3de02ba278f11e20b06a6b6cc018332%22%7D%7D

which shows that rcsb_polymer_entity.rcsb_ec_lineage.id is used to access the query. It would be really helpful for my project if I could search with EC numbers. Thank you for taking the time