1

I want to retrieve Post-translational modifications (PTMs) data from Uniprot via bioservices, I am using following script:

from bioservices import uniprot

u = uniprot.UniProt()

ptm = u.search("P38903", frmt="xls", include=True, columns="features")

and obtain the following outcome:

u'Features\nChain (1); Compositional bias (5); Modified residue (2); Sequence conflict (3)\n'

What I want to have are the details of "Modified residue (2)" i.e. what type of modifications are these and what are the positions, (optional) references as well.

Cleb
  • 25,102
  • 20
  • 116
  • 151
user3698773
  • 929
  • 2
  • 8
  • 15

2 Answers2

1

The short answer is: you can't do it with bioservices. It doesn't support the the column value feature(MODIFIED RESIDUE) where the information is hiding.

But you can get the information by using the Uniprot API. The following Python3 snippet gives you info you need:

import urllib.request
with urllib.request.urlopen('http://www.uniprot.org/uniprot/?query=P38903&format=tab&columns=feature(MODIFIED%20RESIDUE)') as response:
    mod_res = response.read().decode()

residues = mod_res.split('\n')[1].split(';')
for residue in residues:
    print(residue.strip())

Output:

MOD_RES 242 242 Phosphothreonine. {ECO:0000244|PubMed:17330950}.

MOD_RES 257 257 Phosphothreonine. {ECO:0000244|PubMed:18407956}.

Community
  • 1
  • 1
Maximilian Peters
  • 30,348
  • 12
  • 86
  • 99
0

If you wish to obtain the feature(MODIFIED RESIDUE) column, provide its name as follows:

from bioservices import UniProt
u = UniProt()
ptm = u.search("P38903",frmt ="xls", include =True, columns="feature(MODIFIED RESIDUE)")

Just tested with version 1.7.5

disclaimer:I'm the main author of bioservices

Thomas Cokelaer
  • 1,049
  • 1
  • 8
  • 11