Friday 2 June 2017

Retrieve E.C. numbers for Drosophila melanogaster proteins from UniProt

I wanted to do a query of UniProt, to retrieve all the E.C. numbers that it has for D. melanogaster proteins. I found that you can use a query language called 'sparql' for this http://sparql.uniprot.org/. I found that this was the sparql query to get all the E.C. numbers for D. melanogaster proteins:

PREFIX up:<http://purl.uniprot.org/core/>
PREFIX taxon:<http://purl.uniprot.org/taxonomy/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
SELECT ?protein ?enzyme
WHERE
{
          ?protein a up:Protein .
        ?protein up:organism taxon:7227 .
          ?protein up:enzyme ?enzyme .
}