Say I found an interesting protein in a genbank file, e.g.:

 gene            273792..275552
 CDS             273792..275552
                 /product="type IV secretion protein Rhs"

(from https://www.ncbi.nlm.nih.gov/nuccore/NC_002695.2)

I would like to programmatically get a classification of this protein.
The (not new) motivation is that my pipeline finds many proteins, and I want to identify enriched or depleted protein classes (e.g., enrichment for DNA-binding proteins).

By googling for "type IV secretion protein Rhs", I found a UniProt entry which has a link to a QuickGO page, which includes three categories: "transposase activity", "transposition, DNA-mediated" and "DNA binding". From this page I can also get an ancestor chart for each of these categories, e.g.:

DNA binding chart

Optimally, the code would work quickly (preferably locally), and for a description from a CDS feature (e.g.: "type IV secretion protein Rhs") return the GO categories it belongs to. It would be even better to also have the ancestry of each category in a computer-readable format.

What is the best way to do that?
Is there a specific UniProt subset that fits my need (finding GO categories given a protein description)?
Is there a specific GO subset that fits my need (extracting ancestor GO categories as explained here)?

(I figured that GO categories fit my need of classifying proteins, but if a better option exists, please let me know)


1 Answer 1


Using the UniProt website API (https://www.uniprot.org/help/api) this could be done with a query like


or, in tab-separated format:


(Remove the "&limit=10" part from the URL to obtain the full set instead of the first 10 entries.)

You can add colums as described here: https://www.uniprot.org/help/customize, https://www.youtube.com/watch?v=ado1r8IDm3U (video, at about 1min25) or https://insideuniprot.blogspot.com/2015/03

Note that while UniProt tries to improve protein name annotation, the unreviewed section of UniProtKB (i.e. UniProtKB/TrEMBL) is often far from perfect and its accuracy relies on the information provided by the submitter of the nucleotide entry, unless an automatic annotation rule is available to assign a more suitable name (see https://www.uniprot.org/help/protein_names).

Please don't hesitate to contact the UniProt helpdesk if you have any additional questions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.