[ensembl-dev] Inconsistent results when making POST requests to grch37 / variant_recoder

Himanshu Joshi hihi.joshi at gmail.com
Mon Jun 8 07:56:10 BST 2020


Dear Ensembl team,
   I'd like some help with this. I am interested in using
https://grch37.rest.ensembl.org/documentation/info/variant_recoder_post in
obtaining VCF coordinates for a number of variants ( Input being HGVS
coordinates)

I used the Python 3 sample code provided to check what the resulting output
looks like (pasted further below)

In similar fashion to how the GET request works ... I expected something
like this
[{'vcf_string':' ... ', 'input':'NM_..'}
{'warning':' ... ', 'input':'NM_..'}]

i.e. each list item would correspond to one input value .. and each
dictionary would be populated with the resultant 'vcf_string' .. or
'warning' .. if the HGVS input is malformed.

However, the output does not appear to be consistent.

Example 1:

For input values, "NM_000070.2:c.?", "NM_000070.2:c.328C>T", there appears
to be only one list item
{'vcf_string': ['15-42676699-C-A', '15-42676699-C-T'], 'warnings': ["No
variant found with ID 'NM_000070.2:c.?'"], 'input': 'NM_000070.2:c.328C>T'}

This erroneously (I think) mixes the warning from the first input value and
the translated vcf coordinates from the second input value

Example 2:

Some HGVS coordinates that are valid and are properly converted via the GET
request, are not handled here:
e.g. "No variant found with ID 'NM_000070.2:c.545T>A'"

*Code*

import requests, sys

server = "https://grch37.rest.ensembl.org"
ext = "/variant_recoder/homo_sapiens"
headers={ "Content-Type" : "application/json", "Accept" :
"application/json"}
params={"fields":"vcf_string"}
hgvs_ids='{"ids": ["NM_000070.2:c.?", "NM_000070.2:c.328C>T",
"NM_000070.2:c.545T>A", "NM_000070.2:c.701G>A", "NM_000070.2:c.1838del",
"NM_000070.2:c.945+1del", "NM_000070.2:c.1061T>G", "NM_000070.2:c.1079G>A",
"NM_000070.2:c.1342C>G", "NM_000070.2:c.1468C>T", "NM_000070.2:c.550delA?",
"NM_000070.2:c.550del", "NM_000070.2:c.1715G>A",
"NM_000070.2:c.2069_2070del", "NM_000070.2:c.2306G>A",
"NM_000070.2:c.2314_2317del", "NM_000070.2:c.2362_2363delinsTCATCT",
"NM_000070.2:c.946-1G>A", "NM_000070.2:c.1466G>A", "NM_000070.2:c.2230A>G",
"NM_000070.2:c.19_23del", "NM_000070.2:c.257C>T", "NM_000070.2:c.402del",
"NM_000070.2:c.1913A>C", "NM_000070.2:c.1622G>A",
"NM_000070.2:c.598_612del", "NM_000070.2:c.801+1G>A",
"NM_000070.2:c.664G>A", "NM_000070.2:c.2243G>A", "NM_000070.2:c.717del"]}'

r = requests.post(server+ext, headers=headers, data=hgvs_ids, params=params)

if not r.ok:
  r.raise_for_status()

decoded = r.json()
print(repr(decoded))

*Results*

[{'vcf_string': ['15-42676699-C-A', '15-42676699-C-T'], 'warnings':
["No variant found with ID 'NM_000070.2:c.?'"], 'input':
'NM_000070.2:c.328C>T'}, {'input': 'NM_000070.2:c.701G>A', 'warnings':
["No variant found with ID 'NM_000070.2:c.545T>A'"], 'vcf_string':
['15-42681194-G-A']}, {'vcf_string': ['15-42700445-AA-A'], 'input':
'NM_000070.2:c.1838del'}, {'input': 'NM_000070.2:c.1061T>G',
'warnings': ["No variant found with ID 'NM_000070.2:c.945+1del'"],
'vcf_string': ['15-42686485-T-G']}, {'vcf_string':
['15-42686503-G-A'], 'input': 'NM_000070.2:c.1079G>A'}, {'vcf_string':
['15-42691838-C-G', '15-42691838-C-T'], 'input':
'NM_000070.2:c.1342C>G'}, {'input': 'NM_000070.2:c.1468C>T',
'vcf_string': ['15-42693952-C-T']}, {'input': 'NM_000070.2:c.550del',
'vcf_string': ['15-42680001-AA-A'], 'warnings': ["No variant found
with ID 'NM_000070.2:c.550delA?'"]}, {'input':
'NM_000070.2:c.1715G>A', 'vcf_string': ['15-42695170-G-A',
'15-42695170-G-C', '15-42695170-G-T']}, {'vcf_string':
['15-42703124-G-A', '15-42703124-G-C'], 'warnings': ["No variant found
with ID 'NM_000070.2:c.2069_2070del'"], 'input':
'NM_000070.2:c.2306G>A'}, {'input': 'NM_000070.2:c.2314_2317del',
'vcf_string': ['15-42703130-CAGAC-C']}, {'vcf_string':
['15-42703179-TAG-TTCATCT'], 'input':
'NM_000070.2:c.2362_2363delinsTCATCT'}, {'warnings': ["No variant
found with ID 'NM_000070.2:c.946-1G>A'"], 'vcf_string':
['15-42693950-G-A'], 'input': 'NM_000070.2:c.1466G>A'}, {'input':
'NM_000070.2:c.2230A>G', 'vcf_string': ['15-42702831-A-G']},
{'warnings': ["No variant found with ID 'NM_000070.2:c.19_23del'"],
'vcf_string': ['15-42652260-C-T'], 'input': 'NM_000070.2:c.257C>T'},
{'vcf_string': ['15-42678386-CC-C'], 'input': 'NM_000070.2:c.402del'},
{'vcf_string': ['15-42695077-G-A'], 'warnings': ["No variant found
with ID 'NM_000070.2:c.1913A>C'"], 'input': 'NM_000070.2:c.1622G>A'},
{'vcf_string': ['15-42680049-GTTCTGGAGTGCTCTG-G'], 'input':
'NM_000070.2:c.598_612del'}, {'vcf_string': ['15-42681157-G-A'],
'warnings': ["No variant found with ID 'NM_000070.2:c.801+1G>A'"],
'input': 'NM_000070.2:c.664G>A'}, {'input': 'NM_000070.2:c.2243G>A',
'vcf_string': ['15-42702844-G-A']}, {'vcf_string':
['15-42681205-TT-T', '15-42681205-TT-TTT'], 'input':
'NM_000070.2:c.717del'}]


Thanks,

Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20200608/628e248f/attachment.html>


More information about the Dev mailing list