Apologies if this isn't a suitable forum for issue reporting, but I haven't had much success with uniprot's built-in feedback form.
import requests
import time
data = {
"A0A0C5B5G6", "A0A1B0GTW7", "A0JNW5", "A0JP26", "A0PK11", "A1A4S6", "A1A519", "A1L190", "A1L3X0", "A1X283",
"A2A2Y4", "A2RU14", "A2RUB6", "A2RUC4", "A4D1B5", "A4GXA9", "A5D8V7", "A5PLL7", "A6BM72", "A6H8Y1", "A6NCS4",
"A6NFY7", "A6NGG8", "A6NI61", "A6NKB5", "A6NNB3", "A7E2V4", "A7MCY6", "A7MD48", "A7XYQ1", "A8MQ03", "A8MW99",
"A9UHW6", "B1AK53", "B1AL88", "B2RUY7", "B3KU38", "B6A8C7", "B7U540", "C9JLW8", "C9JRZ8", "D3W0D1", "E0CX11",
"O00115", "O00116", "O00159", "O00161", "O00165", "O00168", "O00214",
}
res = requests.post("https://rest.uniprot.org/idmapping/run", data={"ids": ",".join(data), "from": "UniProtKB_AC-ID", "to": "Gene_Name"})
job_id = res.json()["jobId"]
for i in range(20):
status = requests.get(f"https://rest.uniprot.org/idmapping/status/{job_id}")
print(status.json())
time.sleep(5)
{'jobStatus': 'RUNNING'}
{'results': [{'from': 'A6H8Y1', 'to': 'BDP1'}, {'from': 'A6NNB3', 'to': 'IFITM5'}, {'from': 'O00159', 'to': 'MYO1C'}, {'from': 'A4GXA9', 'to': 'EME2'}, {'from': 'A2RUC4', 'to': 'TYW5'}, {'from': 'A6NI61', 'to': 'MYMK'}, {'from': 'A0JP26', 'to': 'POTEB3'}, {'from': 'D3W0D1', 'to': 'KLRF2'}, {'from': 'B3KU38', 'to': 'IQCJ-SCHIP1'}, {'from': 'A5D8V7', 'to': 'ODAD3'}, {'from': 'A7E2V4', 'to': 'ZSWIM8'}, {'from': 'B7U540', 'to': 'KCNJ18'}, {'from': 'A0JNW5', 'to': 'UHRF1BP1L'}, {'from': 'A2RU14', 'to': 'TMEM218'}, {'from': 'A6NCS4', 'to': 'NKX2-6'}, {'from': 'A5PLL7', 'to': 'PEDS1'}, {'from': 'A1L190', 'to': 'SYCE3'}, {'from': 'A6NGG8', 'to': 'PCARE'}, {'from': 'B2RUY7', 'to': 'VWC2L'}, {'from': 'A6NFY7', 'to': 'SDHAF1'}, {'from': 'A2A2Y4', 'to': 'FRMD3'}, {'from': 'C9JRZ8', 'to': 'AKR1B15'}, {'from': 'A7MD48', 'to': 'SRRM4'}, {'from': 'A0A1B0GTW7', 'to': 'CIROP'}, {'from': 'B1AK53', 'to': 'ESPN'}]}
{'results': [{'from': 'A6H8Y1', 'to': 'BDP1'}, {'from': 'A6NNB3', 'to': 'IFITM5'}, {'from': 'O00159', 'to': 'MYO1C'}, {'from': 'A4GXA9', 'to': 'EME2'}, {'from': 'A2RUC4', 'to': 'TYW5'}, {'from': 'A6NI61', 'to': 'MYMK'}, {'from': 'A0JP26', 'to': 'POTEB3'}, {'from': 'D3W0D1', 'to': 'KLRF2'}, {'from': 'B3KU38', 'to': 'IQCJ-SCHIP1'}, {'from': 'A5D8V7', 'to': 'ODAD3'}, {'from': 'A7E2V4', 'to': 'ZSWIM8'}, {'from': 'B7U540', 'to': 'KCNJ18'}, {'from': 'A0JNW5', 'to': 'UHRF1BP1L'}, {'from': 'A2RU14', 'to': 'TMEM218'}, {'from': 'A6NCS4', 'to': 'NKX2-6'}, {'from': 'A5PLL7', 'to': 'PEDS1'}, {'from': 'A1L190', 'to': 'SYCE3'}, {'from': 'A6NGG8', 'to': 'PCARE'}, {'from': 'B2RUY7', 'to': 'VWC2L'}, {'from': 'A6NFY7', 'to': 'SDHAF1'}, {'from': 'A2A2Y4', 'to': 'FRMD3'}, {'from': 'C9JRZ8', 'to': 'AKR1B15'}, {'from': 'A7MD48', 'to': 'SRRM4'}, {'from': 'A0A1B0GTW7', 'to': 'CIROP'}, {'from': 'B1AK53', 'to': 'ESPN'}]}
{'results': [{'from': 'A6H8Y1', 'to': 'BDP1'}, {'from': 'A6NNB3', 'to': 'IFITM5'}, {'from': 'O00159', 'to': 'MYO1C'}, {'from': 'A4GXA9', 'to': 'EME2'}, {'from': 'A2RUC4', 'to': 'TYW5'}, {'from': 'A6NI61', 'to': 'MYMK'}, {'from': 'A0JP26', 'to': 'POTEB3'}, {'from': 'D3W0D1', 'to': 'KLRF2'}, {'from': 'B3KU38', 'to': 'IQCJ-SCHIP1'}, {'from': 'A5D8V7', 'to': 'ODAD3'}, {'from': 'A7E2V4', 'to': 'ZSWIM8'}, {'from': 'B7U540', 'to': 'KCNJ18'}, {'from': 'A0JNW5', 'to': 'UHRF1BP1L'}, {'from': 'A2RU14', 'to': 'TMEM218'}, {'from': 'A6NCS4', 'to': 'NKX2-6'}, {'from': 'A5PLL7', 'to': 'PEDS1'}, {'from': 'A1L190', 'to': 'SYCE3'}, {'from': 'A6NGG8', 'to': 'PCARE'}, {'from': 'B2RUY7', 'to': 'VWC2L'}, {'from': 'A6NFY7', 'to': 'SDHAF1'}, {'from': 'A2A2Y4', 'to': 'FRMD3'}, {'from': 'C9JRZ8', 'to': 'AKR1B15'}, {'from': 'A7MD48', 'to': 'SRRM4'}, {'from': 'A0A1B0GTW7', 'to': 'CIROP'}, {'from': 'B1AK53', 'to': 'ESPN'}]}
Apologies if this isn't a suitable forum for issue reporting, but I haven't had much success with uniprot's built-in feedback form.
Over in multimeric/Unipressed#21 we noticed that the
/idmapping/status/endpoint actually returns the job results once the job finishes, instead of theFINISHEDstatus we would expect.Here's a simple reproducible example using Python:
Which prints:
Note how, I'm only requesting the
/statusendpoint, but somehow only the first request actually gives me the right data format, and all subsequent requests give me results I'd expect from the/idmapping/resultsendpoint.